| @@ 7-36 (lines=30) @@ | ||
| 4 | ||
| 5 | namespace Larium\Specification; |
|
| 6 | ||
| 7 | class GreaterThanOrEqualSpecification extends ValueBoundSpecification |
|
| 8 | { |
|
| 9 | public function isSatisfiedBy(Candidate $candidate): bool |
|
| 10 | { |
|
| 11 | return $candidate->get($this->getAttribute()) >= $this->getValue(); |
|
| 12 | } |
|
| 13 | ||
| 14 | public function isSpecialCaseOfGreaterThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 15 | { |
|
| 16 | return $this->getAttribute() === $specification->getAttribute() |
|
| 17 | && $this->getValue() >= $specification->getValue(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function isSpecialCaseOfGreaterThanSpecification(ValueBoundSpecification $specification): bool |
|
| 21 | { |
|
| 22 | return $this->getAttribute() === $specification->getAttribute() |
|
| 23 | && $this->getValue() > $specification->getValue(); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function isGeneralizationOfGreaterThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 27 | { |
|
| 28 | return $this->getAttribute() === $specification->getAttribute() |
|
| 29 | && $this->getValue() <= $specification->getValue(); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function isGeneralizationOfGreaterThanSpecification(ValueBoundSpecification $specification): bool |
|
| 33 | { |
|
| 34 | return $this->isGeneralizationOfGreaterThanOrEqualSpecification($specification); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 7-36 (lines=30) @@ | ||
| 4 | ||
| 5 | namespace Larium\Specification; |
|
| 6 | ||
| 7 | class GreaterThanSpecification extends ValueBoundSpecification |
|
| 8 | { |
|
| 9 | public function isSatisfiedBy(Candidate $candidate): bool |
|
| 10 | { |
|
| 11 | return $candidate->get($this->getAttribute()) > $this->getValue(); |
|
| 12 | } |
|
| 13 | ||
| 14 | public function isSpecialCaseOfGreaterThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 15 | { |
|
| 16 | return $this->getAttribute() === $specification->getAttribute() |
|
| 17 | && $this->getValue() >= $specification->getValue(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function isSpecialCaseOfGreaterThanSpecification(ValueBoundSpecification $specification): bool |
|
| 21 | { |
|
| 22 | return $this->isSpecialCaseOfGreaterThanOrEqualSpecification($specification); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function isGeneralizationOfGreaterThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 26 | { |
|
| 27 | return $this->getAttribute() === $specification->getAttribute() |
|
| 28 | && $this->getValue() <= $specification->getValue(); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function isGeneralizationOfGreaterThanSpecification(ValueBoundSpecification $specification): bool |
|
| 32 | { |
|
| 33 | return $this->getAttribute() === $specification->getAttribute() |
|
| 34 | && $this->getValue() < $specification->getValue(); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 7-36 (lines=30) @@ | ||
| 4 | ||
| 5 | namespace Larium\Specification; |
|
| 6 | ||
| 7 | class LessThanOrEqualSpecification extends ValueBoundSpecification |
|
| 8 | { |
|
| 9 | public function isSatisfiedBy(Candidate $candidate): bool |
|
| 10 | { |
|
| 11 | return $candidate->get($this->getAttribute()) <= $this->getValue(); |
|
| 12 | } |
|
| 13 | ||
| 14 | public function isSpecialCaseOfLessThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 15 | { |
|
| 16 | return $this->getAttribute() === $specification->getAttribute() |
|
| 17 | && $this->getValue() <= $specification->getValue(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function isSpecialCaseOfLessThanSpecification(ValueBoundSpecification $specification): bool |
|
| 21 | { |
|
| 22 | return $this->getAttribute() === $specification->getAttribute() |
|
| 23 | && $this->getValue() < $specification->getValue(); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function isGeneralizationOfLessThanOrEqualSpecification(ValueBoundSpecification $specification): bool |
|
| 27 | { |
|
| 28 | return $this->getAttribute() === $specification->getAttribute() |
|
| 29 | && $this->getValue() >= $specification->getValue(); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function isGeneralizationOfLessThanSpecification(ValueBoundSpecification $specification): bool |
|
| 33 | { |
|
| 34 | return $this->isGeneralizationOfLessThanOrEqualSpecification($specification); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||