/** * Default constructor * * @param string $operand The operand to check * @param string $type The type are are checking against */ public function __construct($operand, $type) { $this->operand = $operand; $this->type = $type; $this->comparator = '==='; parent::__construct(); }
/** * Default constructor * * @param string $operand The operand we have to check * @param string $type The type we have to check for */ public function __construct($operand, $type) { $this->operand = $operand; $this->validatesTo = true; $this->type = $type; parent::__construct(); }
/** * Default constructor * * @param \AppserverIo\Doppelgaenger\Entities\Lists\AssertionList $assertionList List of assertion to chain together * @param array|string $combinators The combinating operators we have to use * * @throws \InvalidArgumentException */ public function __construct(AssertionList $assertionList, $combinators) { // Set our attributes $this->assertionList = $assertionList; // Set the mapping for our inversion $this->inversionMapping = array('and' => 'or', '&&' => '||', 'or' => 'and', '||' => '&&'); // There must be enough combinators to chain up the assertions. // If not, we do not stand a chance to make this work. // If we got only one combinator as a string (not in an array) we will use it throughout if (!is_array($combinators)) { $this->combinators = array(); for ($i = 1; $i < $assertionList->count(); $i++) { $this->combinators[] = $combinators; } } else { $this->combinators = $combinators; } // No check if the counts are ok if ($assertionList->count() !== count($this->combinators) + 1) { throw new \InvalidArgumentException(); } parent::__construct(); }
/** * Default constructor * * @param string $operand The operand we have to check * @param string $class The name of the class we have to check for */ public function __construct($operand, $class) { $this->operand = $operand; $this->class = $class; parent::__construct(); }