@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function __call($function, $arguments) |
48 | 48 | { |
49 | 49 | if ( ! is_callable($function) || substr($function, 0, 6) !== 'array_') { |
50 | - throw new BadMethodCallException(__CLASS__ . '->' . $function); |
|
50 | + throw new BadMethodCallException(__CLASS__.'->'.$function); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | return call_user_func_array($function, array_merge(array($this->getArrayCopy()), $arguments)); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function hasKey($key) |
65 | 65 | { |
66 | - return array_key_exists($key, (array)$this); |
|
66 | + return array_key_exists($key, (array) $this); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getKeys() |
89 | 89 | { |
90 | - return array_keys((array)$this); |
|
90 | + return array_keys((array) $this); |
|
91 | 91 | } |
92 | 92 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | // TODO: Better way to bootstrap this while still allowing DI? |
66 | 66 | if ( ! $config) { |
67 | - $config = new Config(include(__DIR__ . '/../config/known_features.php')); |
|
67 | + $config = new Config(include(__DIR__.'/../config/known_features.php')); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $this->config = $config; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | if (is_integer($phpVersion)) { |
77 | - $phpVersion = (string)$phpVersion; |
|
77 | + $phpVersion = (string) $phpVersion; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | if (is_string($phpVersion)) { |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | |
118 | 118 | while ($isSupported && count($features) > 0) { |
119 | 119 | $feature = array_pop($features); |
120 | - $isSupported &= (bool)$this->checkSupport($feature); |
|
120 | + $isSupported &= (bool) $this->checkSupport($feature); |
|
121 | 121 | } |
122 | 122 | |
123 | - return (bool)$isSupported; |
|
123 | + return (bool) $isSupported; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | while (count($features) > 0) { |
161 | 161 | $feature = array_pop($features); |
162 | - $isSupported &= (bool)$this->checkSupport($feature, $minimumRequired); |
|
162 | + $isSupported &= (bool) $this->checkSupport($feature, $minimumRequired); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | return $minimumRequired !== '0.0.0' ? new SemanticVersion($minimumRequired, true) : false; |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | |
194 | 194 | while (($isSupported || $minimumRequired) && count($requirements) > 0) { |
195 | 195 | $requirement = array_pop($requirements); |
196 | - $isSupported &= (bool)$this->checkRequirement($requirement, $minimumRequired); |
|
196 | + $isSupported &= (bool) $this->checkRequirement($requirement, $minimumRequired); |
|
197 | 197 | } |
198 | 198 | |
199 | - return (bool)$isSupported; |
|
199 | + return (bool) $isSupported; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |
@@ -223,14 +223,14 @@ discard block |
||
223 | 223 | if ( ! $result || ! isset($arguments[1]) || ! isset($arguments[2])) { |
224 | 224 | throw new RuntimeException(sprintf( |
225 | 225 | 'Could not parse the requirement "%1$s".', |
226 | - (string)$requirement |
|
226 | + (string) $requirement |
|
227 | 227 | )); |
228 | 228 | } |
229 | 229 | |
230 | - $operator = isset($arguments[1]) ? (string)$arguments[1] : '>='; |
|
231 | - $milestone = isset($arguments[2]) ? (string)$arguments[2] : '0.0.0'; |
|
230 | + $operator = isset($arguments[1]) ? (string) $arguments[1] : '>='; |
|
231 | + $milestone = isset($arguments[2]) ? (string) $arguments[2] : '0.0.0'; |
|
232 | 232 | |
233 | - $isSupported = (bool)version_compare($this->version->getVersion(), $milestone, $operator); |
|
233 | + $isSupported = (bool) version_compare($this->version->getVersion(), $milestone, $operator); |
|
234 | 234 | |
235 | 235 | if ($minimumRequired) { |
236 | 236 | $requiredVersion = $this->getRequiredVersion($milestone, $operator); |
@@ -95,22 +95,22 @@ discard block |
||
95 | 95 | if ( ! $result) { |
96 | 96 | throw new RuntimeException(sprintf( |
97 | 97 | 'Failed to validate version "%1$s".', |
98 | - (string)$version |
|
98 | + (string) $version |
|
99 | 99 | )); |
100 | 100 | } |
101 | 101 | |
102 | 102 | if ( ! $partial && ( ! isset($components[2]) || ! isset($components[3]))) { |
103 | 103 | throw new RuntimeException(sprintf( |
104 | 104 | 'Could not accept partial version "%1$s", requested full versions only.', |
105 | - (string)$version |
|
105 | + (string) $version |
|
106 | 106 | )); |
107 | 107 | } |
108 | 108 | |
109 | - $this->setComponent('major', isset($components[1]) ? (int)$components[1] : 0); |
|
110 | - $this->setComponent('minor', isset($components[2]) ? (int)$components[2] : 0); |
|
111 | - $this->setComponent('patch', isset($components[3]) ? (int)$components[3] : 0); |
|
112 | - $this->setComponent('pre-release', isset($components[4]) ? (string)$components[4] : ''); |
|
113 | - $this->setComponent('build', isset($components[5]) ? (string)$components[5] : ''); |
|
109 | + $this->setComponent('major', isset($components[1]) ? (int) $components[1] : 0); |
|
110 | + $this->setComponent('minor', isset($components[2]) ? (int) $components[2] : 0); |
|
111 | + $this->setComponent('patch', isset($components[3]) ? (int) $components[3] : 0); |
|
112 | + $this->setComponent('pre-release', isset($components[4]) ? (string) $components[4] : ''); |
|
113 | + $this->setComponent('build', isset($components[5]) ? (string) $components[5] : ''); |
|
114 | 114 | |
115 | 115 | $version = $this->getVersionFromComponents(); |
116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function getVersion() |
128 | 128 | { |
129 | - return (string)isset($this->version) ? $this->version : '0.0.0'; |
|
129 | + return (string) isset($this->version) ? $this->version : '0.0.0'; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | protected function getVersionFromComponents() |
140 | 140 | { |
141 | 141 | |
142 | - $pre_release = $this->getPreRelease() ? '-' . $this->getPreRelease() : ''; |
|
143 | - $build = $this->getBuild() ? '+' . $this->getBuild() : ''; |
|
142 | + $pre_release = $this->getPreRelease() ? '-'.$this->getPreRelease() : ''; |
|
143 | + $build = $this->getBuild() ? '+'.$this->getBuild() : ''; |
|
144 | 144 | |
145 | 145 | $version = sprintf( |
146 | 146 | '%1$s.%2$s.%3$s%4$s%5$s', |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function getMajor() |
165 | 165 | { |
166 | - return (int)$this->getComponent('major') ?: 0; |
|
166 | + return (int) $this->getComponent('major') ?: 0; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function getMinor() |
177 | 177 | { |
178 | - return (int)$this->getComponent('minor') ?: 0; |
|
178 | + return (int) $this->getComponent('minor') ?: 0; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function getPatch() |
189 | 189 | { |
190 | - return (int)$this->getComponent('patch') ?: 0; |
|
190 | + return (int) $this->getComponent('patch') ?: 0; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function getPreRelease() |
201 | 201 | { |
202 | - return (string)$this->getComponent('pre-release') ?: ''; |
|
202 | + return (string) $this->getComponent('pre-release') ?: ''; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function getBuild() |
214 | 214 | { |
215 | - return (string)$this->getComponent('build') ?: ''; |
|
215 | + return (string) $this->getComponent('build') ?: ''; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -254,6 +254,6 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function __toString() |
256 | 256 | { |
257 | - return (string)$this->getVersion(); |
|
257 | + return (string) $this->getVersion(); |
|
258 | 258 | } |
259 | 259 | } |