| @@ 69-84 (lines=16) @@ | ||
| 66 | /** |
|
| 67 | * @inheritdoc |
|
| 68 | */ |
|
| 69 | public function toBlock(): ExecutionBlockInterface |
|
| 70 | { |
|
| 71 | $operator = new IfOperator( |
|
| 72 | [static::class, 'compare'], |
|
| 73 | new Success(), |
|
| 74 | new Fail($this->getErrorCode(), $this->getErrorContext()), |
|
| 75 | [static::PROPERTY_VALUE => $this->getValue()] |
|
| 76 | ); |
|
| 77 | ||
| 78 | $operator->setParent($this); |
|
| 79 | if ($this->isCaptureEnabled() === true) { |
|
| 80 | $operator->enableCapture(); |
|
| 81 | } |
|
| 82 | ||
| 83 | return ($operator)->toBlock(); |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * @return mixed |
|
| @@ 79-97 (lines=19) @@ | ||
| 76 | /** |
|
| 77 | * @inheritdoc |
|
| 78 | */ |
|
| 79 | public function toBlock(): ExecutionBlockInterface |
|
| 80 | { |
|
| 81 | $operator = new IfOperator( |
|
| 82 | [static::class, 'compare'], |
|
| 83 | new Success(), |
|
| 84 | new Fail($this->getErrorCode(), $this->getErrorContext()), |
|
| 85 | [ |
|
| 86 | static::PROPERTY_LOWER_VALUE => $this->getLowerValue(), |
|
| 87 | static::PROPERTY_UPPER_VALUE => $this->getUpperValue(), |
|
| 88 | ] |
|
| 89 | ); |
|
| 90 | ||
| 91 | $operator->setParent($this); |
|
| 92 | if ($this->isCaptureEnabled() === true) { |
|
| 93 | $operator->enableCapture(); |
|
| 94 | } |
|
| 95 | ||
| 96 | return $operator->toBlock(); |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * @return mixed |
|