| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class IlluminateCollectionFactory implements CollectionFactoryInterface |
||
| 15 | { |
||
| 16 | /** @var class-string<TCollection> */ |
||
|
|
|||
| 17 | private string $class = Collection::class; |
||
| 18 | |||
| 19 | 102 | public function __construct() |
|
| 20 | { |
||
| 21 | 102 | if (!class_exists(Collection::class, true)) { |
|
| 22 | throw new CollectionFactoryException( |
||
| 23 | sprintf( |
||
| 24 | 'There is no %s class. To resolve this issue you can install `illuminate/collections` package.', |
||
| 25 | Collection::class |
||
| 26 | ) |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 90 | public function getInterface(): ?string |
|
| 32 | { |
||
| 33 | 90 | return Collection::class; |
|
| 34 | } |
||
| 35 | |||
| 36 | 6 | public function withCollectionClass(string $class): static |
|
| 41 | } |
||
| 42 | |||
| 43 | 36 | public function collect(iterable $data): Collection |
|
| 46 | } |
||
| 47 | } |
||
| 48 |