@@ -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->getMessage()}", $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->getMessage()}", $e->getCode(), $e); |
65 | 72 | } |
66 | 73 | } |