/** * adds it to $this->notSatisfied if it does not match * * @param Specification $specification * @param mixed $object * @param array &[$notSatisfied] (optional) array to contain the not satisfiedBy @array<Specification) * @return void */ protected function appendIfNotSatisfiedBy($specification, $object, array &$notSatisfied = []) { if (!$specification->isSatisfiedBy($object)) { if ($specification instanceof AbstractCombinationSpecification) { $notSatisfied = array_merge($notSatisfied, $specification->getSpecificationsNotSatisfiedBy($object)); } else { $notSatisfied[] = $specification; } } }
/** * {@inheritdoc} */ public function isSatisfiedBy($candidate) : bool { return $this->firstSpec->isSatisfiedBy($candidate) && $this->secondSpec->isSatisfiedBy($candidate); }
/** * @param mixed $object * @return bool */ public function isSatisfiedBy($object) { return !$this->specification->isSatisfiedBy($object); }
/** * {@inheritdoc} */ public function isSatisfiedBy($candidate) { return $this->one->isSatisfiedBy($candidate) || $this->other->isSatisfiedBy($candidate); }
/** * {@inheritdoc} */ public function isSatisfiedBy($candidate) { return !$this->spec->isSatisfiedBy($candidate); }
/** * @param $object * * @return bool */ public function isSatisfiedBy($object) { return $this->left->isSatisfiedBy($object) && $this->right->isSatisfiedBy($object); }
/** * @param mixed $object * @return bool */ public function isSatisfiedBy($object) { return $this->one->isSatisfiedBy($object) && $this->other->isSatisfiedBy($object); }
/** * {inheritdoc} */ public function isSatisfiedBy($candidate) { return $this->firstPart->isSatisfiedBy($candidate) || $this->secondPart->isSatisfiedBy($candidate); }
/** * * can be 0+, just duplicate to return a single one that is not an array and rename this `findAllSatisfying` * @return array<Object|empty> * */ public function findSatisfying(Specification $specification) { $data = $this->findAll(); $result = array(); foreach ($data as $object) { if ($specification->isSatisfiedBy($object)) { $result[] = $object; } } return $result; }
/** * {inheritdoc} */ public function isSatisfiedBy($candidate) { return !$this->wrappedSpecification->isSatisfiedBy($candidate); }