@@ -25,14 +25,14 @@ |
||
25 | 25 | private function assertFileExists() |
26 | 26 | { |
27 | 27 | if (!file_exists($this->filename)) { |
28 | - throw new FileNotFoundException($this->filename . ' does not exist'); |
|
28 | + throw new FileNotFoundException($this->filename.' does not exist'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | 32 | private function assertConfigIsValid($config) |
33 | 33 | { |
34 | 34 | if (!is_array($config)) { |
35 | - throw new InvalidConfigException($this->filename . ' does not return a PHP array'); |
|
35 | + throw new InvalidConfigException($this->filename.' does not return a PHP array'); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function getKeys() |
26 | 26 | { |
27 | 27 | return array_map( |
28 | - function (ServiceDefinition $definition) { |
|
28 | + function(ServiceDefinition $definition) { |
|
29 | 29 | return $definition->getKey(); |
30 | 30 | }, |
31 | 31 | $this->config |
@@ -22,7 +22,7 @@ |
||
22 | 22 | /** |
23 | 23 | * @api |
24 | 24 | * |
25 | - * @param array $patterns |
|
25 | + * @param string[] $patterns |
|
26 | 26 | * @param string $separator |
27 | 27 | * |
28 | 28 | * @return self |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | if (empty($files)) { |
36 | 36 | throw new NoMatchingFilesException( |
37 | - 'No files found matching patterns: ' . implode(', ', $patterns) |
|
37 | + 'No files found matching patterns: '.implode(', ', $patterns) |
|
38 | 38 | ); |
39 | 39 | } |
40 | 40 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ]); |
45 | 45 | |
46 | 46 | $configs = array_map( |
47 | - function ($filename) use ($factory) { |
|
47 | + function($filename) use ($factory) { |
|
48 | 48 | $reader = $factory->create($filename); |
49 | 49 | return $reader->read($filename); |
50 | 50 | }, |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | foreach ($path as $node) { |
123 | 123 | if (!is_array($pointer) || !array_key_exists($node, $pointer)) { |
124 | - throw new EntryDoesNotExistException("No entry found for " . implode($this->separator, $path)); |
|
124 | + throw new EntryDoesNotExistException("No entry found for ".implode($this->separator, $path)); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $pointer = &$pointer[$node]; |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | $this->prefix = $prefix; |
28 | 28 | $this->config = $config; |
29 | 29 | $this->provides = array_map( |
30 | - function ($key) { |
|
31 | - return $this->keyPrefix() . $key; |
|
30 | + function($key) { |
|
31 | + return $this->keyPrefix().$key; |
|
32 | 32 | }, |
33 | 33 | $config->getKeys() |
34 | 34 | ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $prefix = $this->keyPrefix(); |
42 | 42 | |
43 | 43 | foreach ($iterator as $key => $value) { |
44 | - $this->getContainer()->share($prefix . $key, function () use ($value) { |
|
44 | + $this->getContainer()->share($prefix.$key, function() use ($value) { |
|
45 | 45 | return $value; |
46 | 46 | }); |
47 | 47 | } |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | return ''; |
57 | 57 | } |
58 | 58 | |
59 | - return $this->prefix . $this->config->getSeparator(); |
|
59 | + return $this->prefix.$this->config->getSeparator(); |
|
60 | 60 | } |
61 | 61 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @api |
35 | 35 | * |
36 | - * @param array|ApplicationConfig $config |
|
36 | + * @param ApplicationConfig $config |
|
37 | 37 | * @param array $settings |
38 | 38 | * |
39 | 39 | * @return ConfigServiceProvider |
@@ -68,7 +68,6 @@ discard block |
||
68 | 68 | * @param array|ApplicationConfig $config |
69 | 69 | * @param string $prefix |
70 | 70 | * @param string $separator |
71 | - * @param ServiceProviderInterface[] $subProviders |
|
72 | 71 | */ |
73 | 72 | public function __construct( |
74 | 73 | $config, |
@@ -123,7 +122,7 @@ discard block |
||
123 | 122 | /** |
124 | 123 | * @param string $name |
125 | 124 | * @param array $settings |
126 | - * @param mixed $default |
|
125 | + * @param string $default |
|
127 | 126 | * |
128 | 127 | * @return mixed |
129 | 128 | */ |
@@ -2,12 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace TomPHP\ConfigServiceProvider; |
4 | 4 | |
5 | +use League\Container\ContainerInterface; |
|
5 | 6 | use League\Container\ServiceProvider\AbstractServiceProvider; |
6 | 7 | use League\Container\ServiceProvider\BootableServiceProviderInterface; |
7 | 8 | use League\Container\ServiceProvider\ServiceProviderInterface; |
8 | -use TomPHP\ConfigServiceProvider\Exception\EntryDoesNotExistException; |
|
9 | 9 | use TomPHP\ConfigServiceProvider\League\AggregateServiceProvider; |
10 | -use League\Container\ContainerInterface; |
|
11 | 10 | |
12 | 11 | final class ConfigServiceProvider extends AbstractServiceProvider implements |
13 | 12 | BootableServiceProviderInterface |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace TomPHP\ConfigServiceProvider\League; |
4 | 4 | |
5 | +use League\Container\ContainerAwareTrait; |
|
6 | +use League\Container\ContainerInterface; |
|
5 | 7 | use League\Container\ServiceProvider\AbstractServiceProvider; |
6 | 8 | use League\Container\ServiceProvider\BootableServiceProviderInterface; |
7 | 9 | use League\Container\ServiceProvider\ServiceProviderInterface; |
8 | -use League\Container\ContainerAwareTrait; |
|
9 | -use League\Container\ContainerInterface; |
|
10 | 10 | |
11 | 11 | final class AggregateServiceProvider extends AbstractServiceProvider implements |
12 | 12 | BootableServiceProviderInterface |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | $this->provides = array_reduce( |
29 | 29 | $this->providers, |
30 | - function (array $provides, ServiceProviderInterface $provider) { |
|
30 | + function(array $provides, ServiceProviderInterface $provider) { |
|
31 | 31 | return array_merge($provides, $provider->provides()); |
32 | 32 | }, |
33 | 33 | [] |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * @internal |
34 | 34 | * |
35 | - * @return ServiceProviderInterface |
|
35 | + * @return AggregateServiceProvider |
|
36 | 36 | */ |
37 | 37 | public function getServiceProvider() |
38 | 38 | { |
@@ -35,8 +35,6 @@ |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | - * @param string $interface |
|
39 | - * @param array $config |
|
40 | 38 | */ |
41 | 39 | private function configureInterface(InflectorDefinition $definition) |
42 | 40 | { |