@@ -152,7 +152,7 @@ |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
155 | - * @param \PhpParser\Node\Name|string $name |
|
155 | + * @param Name $name |
|
156 | 156 | * @param int $line |
157 | 157 | */ |
158 | 158 | private function handleFunctionName($name, $line = -1) |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * LibraryChanges.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * LibraryChanges.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\Analysers; |
19 | 19 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param \Pvra\Analyser $analyser |
46 | 46 | * @param \Pvra\InformationProvider\LibraryInformation $information |
47 | 47 | */ |
48 | - public function __construct(array $options = [], Analyser $analyser = null, LibraryInformation $information = null) |
|
48 | + public function __construct(array $options = [ ], Analyser $analyser = null, LibraryInformation $information = null) |
|
49 | 49 | { |
50 | 50 | parent::__construct($options, $analyser); |
51 | 51 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $name = (string)$name; |
112 | 112 | } |
113 | 113 | |
114 | - return [$name, $line]; |
|
114 | + return [ $name, $line ]; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -122,31 +122,31 @@ discard block |
||
122 | 122 | { |
123 | 123 | list($name, $line) = $this->prepareNameAndLine($name, $line); |
124 | 124 | $info = $this->getLibraryInformation()->getClassInfo($name); |
125 | - if ($this->mode & self::MODE_ADDITION && $info['addition'] !== null) { |
|
125 | + if ($this->mode & self::MODE_ADDITION && $info[ 'addition' ] !== null) { |
|
126 | 126 | $this->getResult()->addArbitraryRequirement( |
127 | - $info['addition'], |
|
127 | + $info[ 'addition' ], |
|
128 | 128 | $line, |
129 | 129 | null, |
130 | 130 | Reason::LIB_CLASS_ADDITION, |
131 | - ['className' => $name] |
|
131 | + [ 'className' => $name ] |
|
132 | 132 | ); |
133 | 133 | } |
134 | - if ($this->mode & self::MODE_DEPRECATION && $info['deprecation'] !== null) { |
|
134 | + if ($this->mode & self::MODE_DEPRECATION && $info[ 'deprecation' ] !== null) { |
|
135 | 135 | $this->getResult()->addArbitraryLimit( |
136 | - $info['deprecation'], |
|
136 | + $info[ 'deprecation' ], |
|
137 | 137 | $line, |
138 | 138 | null, |
139 | 139 | Reason::LIB_CLASS_DEPRECATION, |
140 | - ['className' => $name] |
|
140 | + [ 'className' => $name ] |
|
141 | 141 | ); |
142 | 142 | } |
143 | - if ($this->mode & self::MODE_REMOVAL && $info['removal'] !== null) { |
|
143 | + if ($this->mode & self::MODE_REMOVAL && $info[ 'removal' ] !== null) { |
|
144 | 144 | $this->getResult()->addArbitraryLimit( |
145 | - $info['removal'], |
|
145 | + $info[ 'removal' ], |
|
146 | 146 | $line, |
147 | 147 | null, |
148 | 148 | Reason::LIB_CLASS_REMOVAL, |
149 | - ['className' => $name] |
|
149 | + [ 'className' => $name ] |
|
150 | 150 | ); |
151 | 151 | } |
152 | 152 | } |
@@ -159,31 +159,31 @@ discard block |
||
159 | 159 | { |
160 | 160 | list($name, $line) = $this->prepareNameAndLine($name, $line); |
161 | 161 | $info = $this->getLibraryInformation()->getFunctionInfo($name); |
162 | - if ($this->mode & self::MODE_ADDITION && $info['addition'] !== null) { |
|
162 | + if ($this->mode & self::MODE_ADDITION && $info[ 'addition' ] !== null) { |
|
163 | 163 | $this->getResult()->addArbitraryRequirement( |
164 | - $info['addition'], |
|
164 | + $info[ 'addition' ], |
|
165 | 165 | $line, |
166 | 166 | null, |
167 | 167 | Reason::LIB_FUNCTION_ADDITION, |
168 | - ['functionName' => $name] |
|
168 | + [ 'functionName' => $name ] |
|
169 | 169 | ); |
170 | 170 | } |
171 | - if ($this->mode & self::MODE_DEPRECATION && $info['deprecation'] !== null) { |
|
171 | + if ($this->mode & self::MODE_DEPRECATION && $info[ 'deprecation' ] !== null) { |
|
172 | 172 | $this->getResult()->addArbitraryLimit( |
173 | - $info['deprecation'], |
|
173 | + $info[ 'deprecation' ], |
|
174 | 174 | $line, |
175 | 175 | null, |
176 | 176 | Reason::LIB_FUNCTION_DEPRECATION, |
177 | - ['functionName' => $name] |
|
177 | + [ 'functionName' => $name ] |
|
178 | 178 | ); |
179 | 179 | } |
180 | - if ($this->mode & self::MODE_REMOVAL && $info['removal'] !== null) { |
|
180 | + if ($this->mode & self::MODE_REMOVAL && $info[ 'removal' ] !== null) { |
|
181 | 181 | $this->getResult()->addArbitraryLimit( |
182 | - $info['removal'], |
|
182 | + $info[ 'removal' ], |
|
183 | 183 | $line, |
184 | 184 | null, |
185 | 185 | Reason::LIB_FUNCTION_REMOVAL, |
186 | - ['functionName' => $name] |
|
186 | + [ 'functionName' => $name ] |
|
187 | 187 | ); |
188 | 188 | } |
189 | 189 | } |
@@ -196,31 +196,31 @@ discard block |
||
196 | 196 | { |
197 | 197 | list($name, $line) = $this->prepareNameAndLine($name, $line); |
198 | 198 | $info = $this->getLibraryInformation()->getConstantInfo($name); |
199 | - if (($this->mode & self::MODE_ADDITION) && $info['addition'] !== null) { |
|
199 | + if (($this->mode & self::MODE_ADDITION) && $info[ 'addition' ] !== null) { |
|
200 | 200 | $this->getResult()->addArbitraryRequirement( |
201 | - $info['addition'], |
|
201 | + $info[ 'addition' ], |
|
202 | 202 | $line, |
203 | 203 | null, |
204 | 204 | Reason::LIB_CONSTANT_ADDITION, |
205 | - ['constantName' => $name] |
|
205 | + [ 'constantName' => $name ] |
|
206 | 206 | ); |
207 | 207 | } |
208 | - if (($this->mode & self::MODE_DEPRECATION) && $info['deprecation'] !== null) { |
|
208 | + if (($this->mode & self::MODE_DEPRECATION) && $info[ 'deprecation' ] !== null) { |
|
209 | 209 | $this->getResult()->addArbitraryLimit( |
210 | - $info['deprecation'], |
|
210 | + $info[ 'deprecation' ], |
|
211 | 211 | $line, |
212 | 212 | null, |
213 | 213 | Reason::LIB_CONSTANT_DEPRECATION, |
214 | - ['constantName' => $name] |
|
214 | + [ 'constantName' => $name ] |
|
215 | 215 | ); |
216 | 216 | } |
217 | - if (($this->mode & self::MODE_REMOVAL) && $info['removal'] !== null) { |
|
217 | + if (($this->mode & self::MODE_REMOVAL) && $info[ 'removal' ] !== null) { |
|
218 | 218 | $this->getResult()->addArbitraryLimit( |
219 | - $info['removal'], |
|
219 | + $info[ 'removal' ], |
|
220 | 220 | $line, |
221 | 221 | null, |
222 | 222 | Reason::LIB_CONSTANT_REMOVAL, |
223 | - ['constantName' => $name] |
|
223 | + [ 'constantName' => $name ] |
|
224 | 224 | ); |
225 | 225 | } |
226 | 226 | } |
@@ -256,13 +256,13 @@ discard block |
||
256 | 256 | } elseif ($node instanceof Node\Stmt\Class_ |
257 | 257 | || $node instanceof Node\Stmt\Interface_ |
258 | 258 | ) { |
259 | - $names = []; |
|
259 | + $names = [ ]; |
|
260 | 260 | if (!empty($node->implements)) { |
261 | 261 | $names += $node->implements; |
262 | 262 | } |
263 | 263 | if (!empty($node->extends)) { |
264 | 264 | if ($node->extends instanceof Name) { |
265 | - $names[] = $node->extends; |
|
265 | + $names[ ] = $node->extends; |
|
266 | 266 | } else { |
267 | 267 | $names += $node->extends; |
268 | 268 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | /** |
120 | 120 | * @param string $version |
121 | - * @return int |
|
121 | + * @return double |
|
122 | 122 | * @throws \Exception |
123 | 123 | */ |
124 | 124 | private function calculateVersionIdFromString($version) |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | |
439 | 439 | /** |
440 | 440 | * @inheritdoc |
441 | - * @return \ArrayIterator|array|Reasoning[] |
|
441 | + * @return \ArrayIterator |
|
442 | 442 | */ |
443 | 443 | public function getIterator() |
444 | 444 | { |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * AnalysisResult.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained through one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * AnalysisResult.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained through one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | namespace Pvra; |
18 | 18 | |
19 | 19 |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @var array|Reasoning[] |
49 | 49 | */ |
50 | - private $requirements = []; |
|
50 | + private $requirements = [ ]; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @var array|Reasoning[] |
54 | 54 | */ |
55 | - private $limits = []; |
|
55 | + private $limits = [ ]; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @var string|null |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | $version)); |
132 | 132 | } |
133 | 133 | |
134 | - $versionComponents += [2 => 0]; |
|
134 | + $versionComponents += [ 2 => 0 ]; |
|
135 | 135 | |
136 | - return $versionComponents[0] * 10000 + $versionComponents[1] * 100 + $versionComponents[2]; |
|
136 | + return $versionComponents[ 0 ] * 10000 + $versionComponents[ 1 ] * 100 + $versionComponents[ 2 ]; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | $keys = array_keys($this->requirements); |
183 | 183 | |
184 | 184 | if (!empty($keys)) { |
185 | - usort($keys, function ($a, $b) { |
|
185 | + usort($keys, function($a, $b) { |
|
186 | 186 | return version_compare($b, $a); |
187 | 187 | }); |
188 | 188 | |
189 | - return $this->cachedVersionRequirement = $keys[0]; |
|
189 | + return $this->cachedVersionRequirement = $keys[ 0 ]; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | return '5.2.0'; |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | $keys = array_keys($this->limits); |
212 | 212 | |
213 | 213 | if (!empty($keys)) { |
214 | - usort($keys, function ($a, $b) { |
|
214 | + usort($keys, function($a, $b) { |
|
215 | 215 | return version_compare($a, $b); |
216 | 216 | }); |
217 | 217 | |
218 | - return $this->cachedVersionLimit = $keys[0]; |
|
218 | + return $this->cachedVersionLimit = $keys[ 0 ]; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | return '8.0.0'; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $line = -1, |
241 | 241 | $msg = null, |
242 | 242 | $reason = Reason::UNKNOWN, |
243 | - array $data = [] |
|
243 | + array $data = [ ] |
|
244 | 244 | ) { |
245 | 245 | $this->addArbitraryVersionConstraint(self::VERSION_LIMIT_MAX, $version, $line, $msg, $reason, |
246 | 246 | $data); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @return $this |
262 | 262 | * @throws \LogicException Thrown if the reason is unknown or does not have a version requirement associated. |
263 | 263 | */ |
264 | - public function addRequirement($reason, $line = -1, $msg = null, array $data = []) |
|
264 | + public function addRequirement($reason, $line = -1, $msg = null, array $data = [ ]) |
|
265 | 265 | { |
266 | 266 | $version = Reason::getVersionFromReason($reason); |
267 | 267 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @param array $data |
284 | 284 | * @return $this |
285 | 285 | */ |
286 | - public function addLimit($reason, $line = -1, $msg = null, array $data = []) |
|
286 | + public function addLimit($reason, $line = -1, $msg = null, array $data = [ ]) |
|
287 | 287 | { |
288 | 288 | $version = Reason::getVersionFromReason($reason); |
289 | 289 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | $line = -1, |
312 | 312 | $msg = null, |
313 | 313 | $reason = Reason::UNKNOWN, |
314 | - array $data = [] |
|
314 | + array $data = [ ] |
|
315 | 315 | ) { |
316 | 316 | $this->addArbitraryVersionConstraint(self::VERSION_LIMIT_MIN, $version, $line, $msg, $reason, |
317 | 317 | $data); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $line = -1, |
334 | 334 | $msg = null, |
335 | 335 | $reason = Reason::UNKNOWN, |
336 | - array $data = [] |
|
336 | + array $data = [ ] |
|
337 | 337 | ) { |
338 | 338 | if ($this->isSealed()) { |
339 | 339 | throw new \RuntimeException('Impossible to write to already sealed result'); |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | $this->count++; |
344 | 344 | |
345 | 345 | if ($type === self::VERSION_LIMIT_MAX) { |
346 | - $this->requirements[ $version ][] = new Reasoning($reason, $line, $this, $version, $msg, $data); |
|
346 | + $this->requirements[ $version ][ ] = new Reasoning($reason, $line, $this, $version, $msg, $data); |
|
347 | 347 | } elseif ($type === self::VERSION_LIMIT_MIN) { |
348 | - $this->limits[ $version ][] = new Reasoning($reason, $line, $this, $version, $msg, $data); |
|
348 | + $this->limits[ $version ][ ] = new Reasoning($reason, $line, $this, $version, $msg, $data); |
|
349 | 349 | } |
350 | 350 | } |
351 | 351 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | return $this->requirements[ $version ]; |
388 | 388 | } |
389 | 389 | |
390 | - return []; |
|
390 | + return [ ]; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | return $this->limits[ $version ]; |
401 | 401 | } |
402 | 402 | |
403 | - return []; |
|
403 | + return [ ]; |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | /** |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | public function getIterator() |
444 | 444 | { |
445 | 445 | $iterator = new \ArrayIterator(); |
446 | - $data = [$this->getRequirements(), $this->getLimits()]; |
|
447 | - array_walk_recursive($data, function ($value) use ($iterator) { |
|
446 | + $data = [ $this->getRequirements(), $this->getLimits() ]; |
|
447 | + array_walk_recursive($data, function($value) use ($iterator) { |
|
448 | 448 | if ($value instanceof Reasoning) { |
449 | 449 | $iterator->append($value); |
450 | 450 | } |
@@ -182,7 +182,7 @@ |
||
182 | 182 | * This method returns an array having the constants defined by this class as keys and their required |
183 | 183 | * php versions as values. |
184 | 184 | * |
185 | - * @return array |
|
185 | + * @return string[] |
|
186 | 186 | */ |
187 | 187 | protected static function getReasonToVersionBaseValues() |
188 | 188 | { |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Reason.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained through one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * Reason.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained through one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | namespace Pvra\Result; |
18 | 18 | |
19 | 19 | /** |
@@ -29,6 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | /** |
31 | 31 | * @param array $options |
32 | + * @return void |
|
32 | 33 | */ |
33 | 34 | public function __construct(array $options = []); |
34 | 35 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * ResultFormatter.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * ResultFormatter.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\Result\ResultFormatter; |
19 | 19 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * @param array $options |
32 | 32 | */ |
33 | - public function __construct(array $options = []); |
|
33 | + public function __construct(array $options = [ ]); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Generate a string representation of a `Result\Collection` |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * LibraryInformationInterface.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * LibraryInformationInterface.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\InformationProvider; |
19 | 19 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * LibraryInformationAwareInterface.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * LibraryInformationAwareInterface.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\InformationProvider; |
19 | 19 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * LibraryInformation.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * LibraryInformation.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\InformationProvider; |
19 | 19 |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @var array |
29 | 29 | */ |
30 | - private $additions = []; |
|
30 | + private $additions = [ ]; |
|
31 | 31 | /** |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - private $deprecations = []; |
|
34 | + private $deprecations = [ ]; |
|
35 | 35 | /** |
36 | 36 | * @var array |
37 | 37 | */ |
38 | - private $removals = []; |
|
38 | + private $removals = [ ]; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Create a new instance and load default information |
@@ -76,19 +76,19 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @param array $data Array representation of data to represent |
78 | 78 | */ |
79 | - public function __construct(array $data = []) |
|
79 | + public function __construct(array $data = [ ]) |
|
80 | 80 | { |
81 | - if (isset($data['additions'])) { |
|
82 | - $this->additions = $data['additions']; |
|
81 | + if (isset($data[ 'additions' ])) { |
|
82 | + $this->additions = $data[ 'additions' ]; |
|
83 | 83 | } |
84 | - if (isset($data['deprecations'])) { |
|
85 | - $this->deprecations = $data['deprecations']; |
|
84 | + if (isset($data[ 'deprecations' ])) { |
|
85 | + $this->deprecations = $data[ 'deprecations' ]; |
|
86 | 86 | } |
87 | - if (isset($data['removals'])) { |
|
88 | - $this->removals = $data['removals']; |
|
87 | + if (isset($data[ 'removals' ])) { |
|
88 | + $this->removals = $data[ 'removals' ]; |
|
89 | 89 | } |
90 | 90 | |
91 | - $baseArray = ['class' => [], 'function' => [], 'constant' => []]; |
|
91 | + $baseArray = [ 'class' => [ ], 'function' => [ ], 'constant' => [ ] ]; |
|
92 | 92 | $this->additions += $baseArray; |
93 | 93 | $this->deprecations += $baseArray; |
94 | 94 | $this->removals += $baseArray; |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | public function mergeWith(LibraryInformationInterface $info) |
113 | 113 | { |
114 | 114 | $newInfo = $info->toArray(); |
115 | - $this->additions = array_replace_recursive($this->additions, $newInfo['additions']); |
|
116 | - $this->deprecations = array_replace_recursive($this->deprecations, $newInfo['deprecations']); |
|
117 | - $this->removals = array_replace_recursive($this->removals, $newInfo['removals']); |
|
115 | + $this->additions = array_replace_recursive($this->additions, $newInfo[ 'additions' ]); |
|
116 | + $this->deprecations = array_replace_recursive($this->deprecations, $newInfo[ 'deprecations' ]); |
|
117 | + $this->removals = array_replace_recursive($this->removals, $newInfo[ 'removals' ]); |
|
118 | 118 | return $this; |
119 | 119 | } |
120 | 120 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * FileAnalyser.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained through one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * FileAnalyser.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained through one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | namespace Pvra; |
18 | 18 | |
19 | 19 | /** |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Php70Features.php |
|
4 | - * |
|
5 | - * MIT LICENSE |
|
6 | - * |
|
7 | - * LICENSE: This source file is subject to the MIT license. |
|
8 | - * A copy of the licenses text was distributed alongside this |
|
9 | - * file (usually the repository or package root). The text can also |
|
10 | - * be obtained on one of the following sources: |
|
11 | - * * http://opensource.org/licenses/MIT |
|
12 | - * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | - * |
|
14 | - * @author suralc <[email protected]> |
|
15 | - * @license http://opensource.org/licenses/MIT MIT |
|
16 | - */ |
|
3 | + * Php70Features.php |
|
4 | + * |
|
5 | + * MIT LICENSE |
|
6 | + * |
|
7 | + * LICENSE: This source file is subject to the MIT license. |
|
8 | + * A copy of the licenses text was distributed alongside this |
|
9 | + * file (usually the repository or package root). The text can also |
|
10 | + * be obtained on one of the following sources: |
|
11 | + * * http://opensource.org/licenses/MIT |
|
12 | + * * https://github.com/suralc/pvra/blob/master/LICENSE |
|
13 | + * |
|
14 | + * @author suralc <[email protected]> |
|
15 | + * @license http://opensource.org/licenses/MIT MIT |
|
16 | + */ |
|
17 | 17 | |
18 | 18 | namespace Pvra\Analysers; |
19 | 19 |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | class Php70Features extends LanguageFeatureAnalyser implements AnalyserAwareInterface |
43 | 43 | { |
44 | 44 | // move both to be const once 5.6+ is mandatory |
45 | - private static $reservedNames = ['string', 'int', 'float', 'bool', 'null', 'false', 'true']; |
|
46 | - private static $softReservedNames = ['object', 'resource', 'mixed', 'numeric']; |
|
45 | + private static $reservedNames = [ 'string', 'int', 'float', 'bool', 'null', 'false', 'true' ]; |
|
46 | + private static $softReservedNames = [ 'object', 'resource', 'mixed', 'numeric' ]; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @inheritdoc |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | Reason::PHP4_CONSTRUCTOR, |
104 | 104 | $method->getLine(), |
105 | 105 | null, |
106 | - ['name' => $method->name], |
|
106 | + [ 'name' => $method->name ], |
|
107 | 107 | ]; |
108 | 108 | } |
109 | 109 | } |
110 | 110 | if ($possibleCtorInfo !== null) { |
111 | - call_user_func_array([$this->getResult(), 'addLimit'], $possibleCtorInfo); |
|
111 | + call_user_func_array([ $this->getResult(), 'addLimit' ], $possibleCtorInfo); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | { |
137 | 137 | if ($call->name instanceof Node\Name && strcasecmp('class_alias', $call->name->getLast()) === 0 |
138 | 138 | ) { |
139 | - if (isset($call->args[1]) && $call->args[1]->value instanceof Node\Scalar\String_) { |
|
140 | - $value = $call->args[1]->value->value; |
|
141 | - $this->handleClassName($value, $call->args[1]->value->getLine()); |
|
139 | + if (isset($call->args[ 1 ]) && $call->args[ 1 ]->value instanceof Node\Scalar\String_) { |
|
140 | + $value = $call->args[ 1 ]->value->value; |
|
141 | + $this->handleClassName($value, $call->args[ 1 ]->value->getLine()); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | } |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | $baseName = basename(str_replace('\\', '/', $name)); |
183 | 183 | if ($this->mode & self::MODE_DEPRECATION && $this->isNameSoftReserved($name)) { |
184 | 184 | $this->getResult()->addLimit(Reason::SOFT_RESERVED_NAME, $line, null, |
185 | - ['fqn' => $name, 'class' => $baseName]); |
|
185 | + [ 'fqn' => $name, 'class' => $baseName ]); |
|
186 | 186 | } elseif ($this->mode & self::MODE_REMOVAL && $this->isNameReserved($name)) { |
187 | 187 | $this->getResult()->addLimit(Reason::RESERVED_CLASS_NAME, $line, null, |
188 | - ['fqn' => $name, 'class' => $baseName]); |
|
188 | + [ 'fqn' => $name, 'class' => $baseName ]); |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |