| Total Complexity | 7 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | final class PropagateOptionsHelper |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Propagates options' values from a single parent rule to its single child rule. The following options' values are |
||
| 19 | * propagated: |
||
| 20 | * |
||
| 21 | * - `$skipOnEmpty` (both rules must implement {@see SkipOnEmptyInterface}). |
||
| 22 | * - `$skipOnError` (both rules must implement {@see SkipOnErrorInterface}). |
||
| 23 | * - `$when` (both rules must implement {@see WhenInterface}). |
||
| 24 | * |
||
| 25 | * @param RuleInterface $parentRule A parent rule which options' values need to be propagated. |
||
| 26 | * @param RuleInterface $childRule A child rule which options' values must be changed to be the same as in parent. |
||
| 27 | * |
||
| 28 | * @return RuleInterface A child rule with changed options' values or unchanged if none of the required interfaces |
||
| 29 | * were implemented. |
||
| 30 | */ |
||
| 31 | public static function propagateForSingleRule(RuleInterface $parentRule, RuleInterface $childRule): RuleInterface |
||
| 48 |