| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | trait SkipOnErrorTrait |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * An immutable setter to change `$skipOnError` property. |
||
| 24 | * |
||
| 25 | * @param bool $value A new value. `true` means to skip the current rule when the previous one errored and `false` - |
||
| 26 | * do not skip. |
||
| 27 | * |
||
| 28 | * @return $this The new instance with a changed value. |
||
| 29 | */ |
||
| 30 | public function skipOnError(bool $value): static |
||
| 31 | { |
||
| 32 | $new = clone $this; |
||
| 33 | $new->skipOnError = $value; |
||
|
|
|||
| 34 | return $new; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * A getter for `$skipOnError` property. |
||
| 39 | * |
||
| 40 | * @return bool Current value. `true` means to skip the current rule when the previous one errored and `false` - do |
||
| 41 | * not skip. |
||
| 42 | */ |
||
| 43 | public function shouldSkipOnError(): bool |
||
| 46 | } |
||
| 47 | } |
||
| 48 |