| 1 | <?php |
||
| 9 | class Factory implements RequiresMandatoryOptions, RequiresConfig |
||
| 10 | { |
||
| 11 | const VENDOR_NAME = 'sinergi'; |
||
| 12 | const PACKAGE_NAME = 'config'; |
||
| 13 | |||
| 14 | use ConfigurationTrait; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param array|Configuration $config |
||
| 18 | * @return Collection |
||
| 19 | */ |
||
| 20 | 20 | public function __invoke($config) |
|
| 21 | { |
||
| 22 | 20 | if (is_array($config)) { |
|
| 23 | 20 | $config = new Configuration($config); |
|
| 24 | } |
||
| 25 | |||
| 26 | 20 | return new Collection($config); |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function vendorName() |
||
| 33 | { |
||
| 34 | return self::VENDOR_NAME; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function packageName() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string[] List with mandatory options |
||
| 47 | */ |
||
| 48 | public function mandatoryOptions() |
||
| 49 | { |
||
| 50 | return []; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string[] List with optional options |
||
| 55 | */ |
||
| 56 | public function optionalOptions() |
||
| 57 | { |
||
| 58 | return [ |
||
| 59 | 'path', |
||
| 60 | 'paths', |
||
| 61 | 'environment', |
||
| 62 | 'dotenv', |
||
| 63 | ]; |
||
| 64 | } |
||
| 65 | |||
| 66 | public function dimensions() |
||
| 70 | } |
||
| 71 |