1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Micro framework package. |
||
5 | * |
||
6 | * (c) Stanislau Komar <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Micro\Framework\Kernel\Configuration; |
||
13 | |||
14 | class PluginConfiguration implements PluginConfigurationInterface |
||
15 | { |
||
16 | 3 | public function __construct( |
|
17 | protected readonly ApplicationConfigurationInterface $configuration |
||
18 | ) { |
||
19 | 3 | } |
|
20 | |||
21 | /** |
||
22 | * @param string|string[] $list |
||
23 | * |
||
24 | * @return string[] |
||
25 | */ |
||
26 | 3 | protected function explodeStringToArray(string|array $list, string $separator = ','): array |
|
27 | { |
||
28 | 3 | if (\is_array($list)) { |
|
0 ignored issues
–
show
introduced
by
![]() |
|||
29 | 3 | return $list; |
|
30 | } |
||
31 | |||
32 | 3 | if ('' === $separator) { |
|
33 | 3 | return [$list]; |
|
34 | } |
||
35 | |||
36 | 3 | $itemsColl = explode($separator, $list); |
|
37 | |||
38 | 3 | return array_map('trim', $itemsColl); |
|
39 | } |
||
40 | } |
||
41 |