| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CollectionFactory extends BaseFactory |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Array of ResourceObjectFactory or ResourceIdentifierFactory objects |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | public $array; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Undocumented function |
||
| 18 | * |
||
| 19 | * @param array<ResourceIdentifierFactory>|array<ResourceObjectFactory> $collection |
||
| 20 | * @return static |
||
| 21 | */ |
||
| 22 | public function setCollection($collection) |
||
| 23 | { |
||
| 24 | $this->array = $collection; |
||
| 25 | |||
| 26 | return $this; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function toArray(): ?array |
||
| 38 | } |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Undocumented function |
||
| 44 | * |
||
| 45 | * @param callable $callback |
||
| 46 | * @return static |
||
| 47 | */ |
||
| 48 | public function each($callback) |
||
| 49 | { |
||
| 50 | array_walk($this->array, $callback); |
||
| 51 | |||
| 52 | return $this; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function map($callback): array |
||
| 58 | } |
||
| 59 | } |
||
| 60 |