@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getDefinedOptions() |
54 | 54 | { |
55 | - if (! $this->defined) { |
|
55 | + if ( ! $this->defined) { |
|
56 | 56 | return null; |
57 | 57 | } |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return $this->defined->getArrayCopy(); |
61 | 61 | } |
62 | 62 | |
63 | - return (array)$this->defined; |
|
63 | + return (array) $this->defined; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function getDefaultOptions() |
74 | 74 | { |
75 | - if (! $this->defaults) { |
|
75 | + if ( ! $this->defaults) { |
|
76 | 76 | return null; |
77 | 77 | } |
78 | 78 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return $this->defaults->getArrayCopy(); |
81 | 81 | } |
82 | 82 | |
83 | - return (array)$this->defaults; |
|
83 | + return (array) $this->defaults; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getRequiredOptions() |
94 | 94 | { |
95 | - if (! $this->required) { |
|
95 | + if ( ! $this->required) { |
|
96 | 96 | return null; |
97 | 97 | } |
98 | 98 | |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | return $this->required->getArrayCopy(); |
101 | 101 | } |
102 | 102 | |
103 | - return (array)$this->required; |
|
103 | + return (array) $this->required; |
|
104 | 104 | } |
105 | 105 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $schema = $schema->getArrayCopy(); |
64 | 64 | } |
65 | 65 | |
66 | - if (! is_array($schema)) { |
|
66 | + if ( ! is_array($schema)) { |
|
67 | 67 | throw new InvalidArgumentException( |
68 | 68 | sprintf( |
69 | 69 | _('Invalid schema source: %1$s'), |
@@ -88,7 +88,7 @@ |
||
88 | 88 | public static function getLoader($loaderClass) |
89 | 89 | { |
90 | 90 | try { |
91 | - if (! array_key_exists($loaderClass, static::$loaderInstances)) { |
|
91 | + if ( ! array_key_exists($loaderClass, static::$loaderInstances)) { |
|
92 | 92 | static::$loaderInstances[$loaderClass] = new $loaderClass; |
93 | 93 | } |
94 | 94 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | */ |
87 | 87 | protected function validateUri($uri) |
88 | 88 | { |
89 | - if (! is_readable($uri)) { |
|
89 | + if ( ! is_readable($uri)) { |
|
90 | 90 | throw new FailedToLoadConfigException( |
91 | 91 | sprintf( |
92 | 92 | _('The requested PHP config file "%1$s" does not exist or is not readable.'), |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->validator = $validator; |
84 | 84 | |
85 | 85 | // Make sure $config is either a string or array. |
86 | - if (! (is_string($config) || is_array($config))) { |
|
86 | + if ( ! (is_string($config) || is_array($config))) { |
|
87 | 87 | throw new InvalidConfigurationSourceException( |
88 | 88 | sprintf( |
89 | 89 | _('Invalid configuration source: %1$s'), |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | // Finally, validate the resulting config. |
116 | - if (! $this->isValid()) { |
|
116 | + if ( ! $this->isValid()) { |
|
117 | 117 | throw new InvalidConfigException( |
118 | 118 | sprintf( |
119 | 119 | _('ConfigInterface file is not valid: %1$s'), |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | protected function resolveOptions($config) |
154 | 154 | { |
155 | - if (! $this->schema) { |
|
155 | + if ( ! $this->schema) { |
|
156 | 156 | return $config; |
157 | 157 | } |
158 | 158 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $defaults = $this->schema->getDefaultOptions(); |
194 | 194 | $required = $this->schema->getRequiredOptions(); |
195 | 195 | |
196 | - if (! $defined && ! $defaults && ! $required) { |
|
196 | + if ( ! $defined && ! $defaults && ! $required) { |
|
197 | 197 | return false; |
198 | 198 | } |
199 | 199 |
@@ -139,7 +139,7 @@ |
||
139 | 139 | { |
140 | 140 | $configFile = method_exists($this, 'getDefaultConfigFile') |
141 | 141 | ? $this->getDefaultConfigFile() |
142 | - : __DIR__ . '/../config/defaults.php'; |
|
142 | + : __DIR__.'/../config/defaults.php'; |
|
143 | 143 | |
144 | 144 | return $this->fetchConfig($configFile); |
145 | 145 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | try { |
58 | 58 | $file = array_pop($files); |
59 | 59 | |
60 | - if (! is_readable($file)) { |
|
60 | + if ( ! is_readable($file)) { |
|
61 | 61 | continue; |
62 | 62 | } |
63 | 63 | |
64 | 64 | $config = static::createFromArray( |
65 | - static::getFromCache($file, function ($file) { |
|
65 | + static::getFromCache($file, function($file) { |
|
66 | 66 | return Loader::load($file); |
67 | 67 | }) |
68 | 68 | ); |
@@ -177,11 +177,11 @@ discard block |
||
177 | 177 | try { |
178 | 178 | $file = array_pop($files); |
179 | 179 | |
180 | - if (! is_readable($file)) { |
|
180 | + if ( ! is_readable($file)) { |
|
181 | 181 | continue; |
182 | 182 | } |
183 | 183 | |
184 | - $new_data = static::getFromCache($file, function ($file) { |
|
184 | + $new_data = static::getFromCache($file, function($file) { |
|
185 | 185 | return Loader::load($file); |
186 | 186 | }); |
187 | 187 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | protected static function getFromCache($identifier, $fallback) |
240 | 240 | { |
241 | - if (! array_key_exists($identifier, static::$configFilesCache)) { |
|
241 | + if ( ! array_key_exists($identifier, static::$configFilesCache)) { |
|
242 | 242 | static::$configFilesCache[$identifier] = is_callable($fallback) |
243 | 243 | ? $fallback($identifier) |
244 | 244 | : $fallback; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | parent::__construct($config, ArrayObject::ARRAY_AS_PROPS); |
52 | 52 | |
53 | 53 | if (null !== $delimiter) { |
54 | - $this->delimiter = (array)$delimiter; |
|
54 | + $this->delimiter = (array) $delimiter; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $array = $this->getArrayCopy(); |
103 | 103 | while (count($keys) > 0) { |
104 | 104 | $key = array_pop($keys); |
105 | - if (! array_key_exists($key, $array)) { |
|
105 | + if ( ! array_key_exists($key, $array)) { |
|
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | $array = $array[$key]; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function getKeys() |
136 | 136 | { |
137 | - return array_keys((array)$this); |
|
137 | + return array_keys((array) $this); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | { |
172 | 172 | $keys = $this->getKeyArguments(func_get_args()); |
173 | 173 | |
174 | - if (! $this->hasKey($keys)) { |
|
174 | + if ( ! $this->hasKey($keys)) { |
|
175 | 175 | throw new KeyNotFoundException( |
176 | 176 | sprintf( |
177 | 177 | _('The configuration key %1$s does not exist.'), |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | // Replace all of the configured delimiters by the first one, so that we can then use explode(). |
234 | 234 | $normalizedString = str_replace($this->delimiter, $this->delimiter[0], $keyString); |
235 | 235 | |
236 | - return (array)explode($this->delimiter[0], $normalizedString); |
|
236 | + return (array) explode($this->delimiter[0], $normalizedString); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $data = json_decode(file_get_contents($uri), true); |
59 | 59 | ob_end_clean(); |
60 | 60 | |
61 | - return (array)$data; |
|
61 | + return (array) $data; |
|
62 | 62 | } catch (Exception $exception) { |
63 | 63 | throw new FailedToLoadConfigException( |
64 | 64 | sprintf( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function validateUri($uri) |
86 | 86 | { |
87 | - if (! is_readable($uri)) { |
|
87 | + if ( ! is_readable($uri)) { |
|
88 | 88 | throw new FailedToLoadConfigException( |
89 | 89 | sprintf( |
90 | 90 | _('The requested JSON config file "%1$s" does not exist or is not readable.'), |