function empty(): self {
    if (is_object($this->target) && !($this->target instanceof \Countable)) {
      $constraint = countOf(0);
      $target = get_object_vars($this->target);
    }
    else if (is_string($this->target)) {
      $constraint = equalTo(0);
      $target = $this->hasFlag('file') ? @filesize($this->target) : mb_strlen($this->target);
      // TODO file/directory flag handling!
    }
    else {
      $constraint = isEmpty();
      $target = $this->target;
    }

    return $this->expect($target, $constraint);
  }
function empty(): self {
    if (is_object($this->target) && !($this->target instanceof \Countable)) {
      $constraint = countOf(0);
      $target = get_object_vars($this->target);
    }
    else if (is_string($this->target)) {
      $constraint = equalTo(0);
      $target = $this->hasFlag('file') ? @filesize($this->target) : mb_strlen($this->target);
      // TODO file/directory flag handling!
    }
    else {
      $constraint = isEmpty();
      $target = $this->target;
    }

    return $this->expect($target, $constraint);
  }
function empty ( ) : self { if ( is_object ( $ this -> target ) && ! ( $ this -> target instanceof \ Countable ) ) { $ constraint = countOf ( 0 ) ; $ target = get_object_vars ( $ this -> target ) ; } else if ( is_string ( $ this -> target ) ) { $ constraint = equalTo ( 0 ) ; $ target = $ this -> hasFlag ( 'file' ) ? @ filesize ( $ this -> target ) : mb_strlen ( $ this -> target ) ; // TODO file/directory flag handling! } else { $ constraint = isEmpty ( ) ; $ target = $ this -> target ; } return $ this -> expect ( $ target , $ constraint ) ; }
Reports an error if the target is not empty.
For arrays, strings, and `Countable` instances, it checks the length. For objects, it gets the count of accessible properties according to scope.
@return self This instance.
Reports an error if the target is not empty . For arrays strings and Countable instances it checks the length . For objects it gets the count of accessible properties according to scope .