| Total Complexity | 0 |
| Total Lines | 87 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | final class ChildParameters |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The child name |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $name; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The inner element instance |
||
| 26 | * |
||
| 27 | * @var ElementInterface |
||
| 28 | */ |
||
| 29 | public $element; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Http Fields to use |
||
| 33 | * |
||
| 34 | * @var HttpFieldsInterface |
||
| 35 | */ |
||
| 36 | public $fields; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var FilterInterface[] |
||
| 40 | */ |
||
| 41 | public $filters; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @var mixed |
||
| 45 | */ |
||
| 46 | public $defaultValue; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var HydratorInterface|null |
||
| 50 | */ |
||
| 51 | public $hydrator; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var ExtractorInterface|null |
||
| 55 | */ |
||
| 56 | public $extractor; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Array of dependencies child names |
||
| 60 | * |
||
| 61 | * @var string[] |
||
| 62 | */ |
||
| 63 | public $dependencies; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @var TransformerInterface|null |
||
| 67 | */ |
||
| 68 | public $modelTransformer; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * The child class name |
||
| 72 | * |
||
| 73 | * @var class-string<ChildInterface> |
||
|
|
|||
| 74 | */ |
||
| 75 | public $className; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * The child instance |
||
| 79 | * Set a value to ignore the default child instantiation on the ChildBuilder |
||
| 80 | * |
||
| 81 | * @var ChildInterface|null |
||
| 82 | */ |
||
| 83 | public $child; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * List of child factories to apply |
||
| 87 | * The return value of each factories will fill the $this->child field |
||
| 88 | * |
||
| 89 | * This parameter can be used to decorate a child instance like : |
||
| 90 | * <code> |
||
| 91 | * public function decorateChild(ChildParameters $parameters) |
||
| 92 | * { |
||
| 93 | * $parameters->factories[] = function (ChildParameters $parameters) { |
||
| 94 | * return new MyChildWrapper($parameters->child); |
||
| 95 | * }; |
||
| 96 | * } |
||
| 97 | * </code> |
||
| 98 | * |
||
| 99 | * @var (callable(ChildParameters):ChildInterface)[] |
||
| 100 | */ |
||
| 101 | public $factories = []; |
||
| 102 | } |
||
| 103 |