| @@ 18-35 (lines=18) @@ | ||
| 15 | * |
|
| 16 | * @author Karel Osorio Ramírez <[email protected]> |
|
| 17 | */ |
|
| 18 | class NotSame extends BinaryConstraintOperator |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * {@inheritdoc} |
|
| 22 | */ |
|
| 23 | public function evaluate($value) |
|
| 24 | { |
|
| 25 | return $this->left()->apply($value) !== $this->right()->apply($value); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritdoc} |
|
| 30 | */ |
|
| 31 | public function not() |
|
| 32 | { |
|
| 33 | return new Same($this->left(), $this->right()); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 18-35 (lines=18) @@ | ||
| 15 | * |
|
| 16 | * @author Karel Osorio Ramírez <[email protected]> |
|
| 17 | */ |
|
| 18 | class Same extends BinaryConstraintOperator |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * {@inheritdoc} |
|
| 22 | */ |
|
| 23 | public function evaluate($value) |
|
| 24 | { |
|
| 25 | return $this->left()->apply($value) === $this->right()->apply($value); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritdoc} |
|
| 30 | */ |
|
| 31 | public function not() |
|
| 32 | { |
|
| 33 | return new NotSame($this->left(), $this->right()); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||