@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $core = TestCore::init([ |
25 | 25 | 'root' => __DIR__, |
26 | - 'config' => __DIR__ . '/config' |
|
26 | + 'config' => __DIR__.'/config' |
|
27 | 27 | ]); |
28 | 28 | |
29 | 29 | /** @var TestConfig $config */ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $core = TestCore::init([ |
38 | 38 | 'root' => __DIR__, |
39 | - 'config' => __DIR__ . '/config', |
|
39 | + 'config' => __DIR__.'/config', |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | /** @var ConfiguratorInterface $config */ |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | public function addLoader(string $ext, FileLoaderInterface $loader): void |
61 | 61 | { |
62 | - if (!isset($this->loaders[$ext]) || get_class($this->loaders[$ext]) !== get_class($loader)) { |
|
62 | + if (!isset($this->loaders[$ext]) || get_class($this->loaders[$ext]) !== get_class($loader)){ |
|
63 | 63 | $this->loaders[$ext] = $loader; |
64 | 64 | $this->container->bindSingleton(ConfigManager::class, $this->createConfigManager()); |
65 | 65 | } |
@@ -59,7 +59,8 @@ |
||
59 | 59 | |
60 | 60 | public function addLoader(string $ext, FileLoaderInterface $loader): void |
61 | 61 | { |
62 | - if (!isset($this->loaders[$ext]) || get_class($this->loaders[$ext]) !== get_class($loader)) { |
|
62 | + if (!isset($this->loaders[$ext]) || get_class($this->loaders[$ext]) !== get_class($loader)) |
|
63 | + { |
|
63 | 64 | $this->loaders[$ext] = $loader; |
64 | 65 | $this->container->bindSingleton(ConfigManager::class, $this->createConfigManager()); |
65 | 66 | } |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function has(string $section): bool |
39 | 39 | { |
40 | - foreach ($this->loaderExtensions() as $extension) { |
|
40 | + foreach ($this->loaderExtensions() as $extension){ |
|
41 | 41 | $filename = sprintf('%s/%s.%s', $this->directory, $section, $extension); |
42 | - if (file_exists($filename)) { |
|
42 | + if (file_exists($filename)){ |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | } |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function load(string $section): array |
54 | 54 | { |
55 | - foreach ($this->loaderExtensions() as $extension) { |
|
55 | + foreach ($this->loaderExtensions() as $extension){ |
|
56 | 56 | $filename = sprintf('%s/%s.%s', $this->directory, $section, $extension); |
57 | - if (!file_exists($filename)) { |
|
57 | + if (!file_exists($filename)){ |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
61 | - try { |
|
61 | + try{ |
|
62 | 62 | return $this->getLoader($extension)->loadFile($section, $filename); |
63 | - } catch (LoaderException $e) { |
|
63 | + }catch (LoaderException $e){ |
|
64 | 64 | throw new LoaderException("Unable to load config `{$section}`.", $e->getCode(), $e); |
65 | 65 | } |
66 | 66 | } |
@@ -37,9 +37,11 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function has(string $section): bool |
39 | 39 | { |
40 | - foreach ($this->loaderExtensions() as $extension) { |
|
40 | + foreach ($this->loaderExtensions() as $extension) |
|
41 | + { |
|
41 | 42 | $filename = sprintf('%s/%s.%s', $this->directory, $section, $extension); |
42 | - if (file_exists($filename)) { |
|
43 | + if (file_exists($filename)) |
|
44 | + { |
|
43 | 45 | return true; |
44 | 46 | } |
45 | 47 | } |
@@ -52,15 +54,20 @@ discard block |
||
52 | 54 | */ |
53 | 55 | public function load(string $section): array |
54 | 56 | { |
55 | - foreach ($this->loaderExtensions() as $extension) { |
|
57 | + foreach ($this->loaderExtensions() as $extension) |
|
58 | + { |
|
56 | 59 | $filename = sprintf('%s/%s.%s', $this->directory, $section, $extension); |
57 | - if (!file_exists($filename)) { |
|
60 | + if (!file_exists($filename)) |
|
61 | + { |
|
58 | 62 | continue; |
59 | 63 | } |
60 | 64 | |
61 | - try { |
|
65 | + try |
|
66 | + { |
|
62 | 67 | return $this->getLoader($extension)->loadFile($section, $filename); |
63 | - } catch (LoaderException $e) { |
|
68 | + } |
|
69 | + catch (LoaderException $e) |
|
70 | + { |
|
64 | 71 | throw new LoaderException("Unable to load config `{$section}`.", $e->getCode(), $e); |
65 | 72 | } |
66 | 73 | } |