__get() public méthode

public __get ( $property )
Exemple #1
0
 public function __get($asserter)
 {
     switch (strtolower($asserter)) {
         case 'keys':
             return $this->getKeysAsserter();
         case 'size':
             return $this->getSizeAsserter();
         case 'isempty':
             return $this->isEmpty();
         case 'isnotempty':
             return $this->isNotEmpty();
         case 'child':
             $asserter = new phpArray\child($this);
             $this->resetInnerAsserter();
             return $asserter->setWith($this->value);
         default:
             $asserter = parent::__get($asserter);
             if ($asserter instanceof variable === false) {
                 $this->resetInnerAsserter();
                 return $asserter;
             } else {
                 if ($this->innerAsserter === null || $this->innerAsserterUsed === true) {
                     $this->innerValue = $this->value;
                     $this->innerAsserterUsed = false;
                 }
                 $this->innerAsserter = $asserter;
                 return $this;
             }
     }
 }
Exemple #2
0
 public function __get($property)
 {
     switch ($property) {
         case 'toString':
             return $this->toString();
         default:
             return parent::__get($property);
     }
 }
Exemple #3
0
 public function __get($property)
 {
     switch (strtolower($property)) {
         case 'iszero':
             return $this->isZero();
         default:
             return parent::__get($property);
     }
 }
Exemple #4
0
 public function __get($property)
 {
     switch (strtolower($property)) {
         case 'isfalse':
         case 'istrue':
             return $this->{$property}();
         default:
             return parent::__get($property);
     }
 }
Exemple #5
0
 public function __get($property)
 {
     switch (true) {
         case strtolower($property) == 'isfalse':
             return $this->isFalse();
         case strtolower($property) == 'istrue':
             return $this->isTrue();
         default:
             return parent::__get($property);
     }
 }
Exemple #6
0
 public function __get($property)
 {
     switch (strtolower($property)) {
         case 'tostring':
         case 'isempty':
         case 'istestedinstance':
         case 'isnottestedinstance':
         case 'isinstanceoftestedclass':
             return $this->{$property}();
         default:
             return parent::__get($property);
     }
 }
Exemple #7
0
 public function __get($asserter)
 {
     switch ($asserter) {
         case 'keys':
             return $this->getKeysAsserter();
         case 'size':
             return $this->getSizeAsserter();
         default:
             $asserter = parent::__get($asserter);
             if ($asserter instanceof asserters\variable === false) {
                 $this->resetInnerAsserter();
                 return $asserter;
             } else {
                 if ($this->innerAsserter === null || $this->innerAsserterUsed === true) {
                     $this->innerValue = $this->value;
                     $this->innerAsserterUsed = false;
                 }
                 $this->innerAsserter = $asserter;
                 return $this;
             }
     }
 }