@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * LanguageFeatureAnalyser.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 | + * LanguageFeatureAnalyser.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\Analysers; |
18 | 18 | |
19 | 19 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | * @param \Pvra\Analyser $analyser |
65 | 65 | * @see setOwningAnalyser() Set the owning analyser |
66 | 66 | */ |
67 | - public function __construct(array $options = [], Analyser $analyser = null) |
|
67 | + public function __construct(array $options = [ ], Analyser $analyser = null) |
|
68 | 68 | { |
69 | 69 | $this->options = $options; |
70 | 70 | $this->mode = $this->getOption('mode', self::MODE_ALL); |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Php54Features.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 | + * Php54Features.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\Analysers; |
18 | 18 | |
19 | 19 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Php55Features.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 | + * Php55Features.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\Analysers; |
18 | 18 | |
19 | 19 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Php56Features.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 | + * Php56Features.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\Analysers; |
18 | 18 | |
19 | 19 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * ExtendedEmulativeLexer.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 | + * ExtendedEmulativeLexer.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 | namespace Pvra\Lexer; |
18 | 18 | |
19 | 19 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public static function createDefaultInstance() |
42 | 42 | { |
43 | 43 | $class = get_called_class(); |
44 | - return new $class(['usedAttributes' => ['startLine', 'endLine', 'startFilePos', 'startTokenPos']]); |
|
44 | + return new $class([ 'usedAttributes' => [ 'startLine', 'endLine', 'startFilePos', 'startTokenPos' ] ]); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | |
65 | 65 | if ($tokenId === Tokens::T_LNUMBER || $tokenId === Tokens::T_DNUMBER) { |
66 | 66 | // could also use $startAttributes, doesn't really matter here |
67 | - $endAttributes['originalValue'] = $value; |
|
67 | + $endAttributes[ 'originalValue' ] = $value; |
|
68 | 68 | } elseif ($tokenId === Tokens::T_START_HEREDOC) { |
69 | - $startAttributes['isDocSyntax'] = true; |
|
70 | - if (substr($this->code, $startAttributes['startFilePos'] + 3, 1) === '\'') { |
|
71 | - $startAttributes['isNowDoc'] = true; |
|
69 | + $startAttributes[ 'isDocSyntax' ] = true; |
|
70 | + if (substr($this->code, $startAttributes[ 'startFilePos' ] + 3, 1) === '\'') { |
|
71 | + $startAttributes[ 'isNowDoc' ] = true; |
|
72 | 72 | } else { |
73 | - $startAttributes['isHereDoc'] = true; |
|
73 | + $startAttributes[ 'isHereDoc' ] = true; |
|
74 | 74 | } |
75 | 75 | } elseif ($tokenId === Tokens::T_ARRAY) { |
76 | - $startAttributes['traditionalArray'] = true; |
|
76 | + $startAttributes[ 'traditionalArray' ] = true; |
|
77 | 77 | } elseif ($tokenId === Tokens::T_ECHO) { |
78 | - if (substr($this->code, $startAttributes['startFilePos'], 3) === '<?=') { |
|
79 | - $startAttributes['isShortEchoTag'] = true; |
|
78 | + if (substr($this->code, $startAttributes[ 'startFilePos' ], 3) === '<?=') { |
|
79 | + $startAttributes[ 'isShortEchoTag' ] = true; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Analyser.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 | + * Analyser.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 | - * AnalyserAwareInterface.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 | + * AnalyserAwareInterface.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 | - * DirCommand.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 | + * DirCommand.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\Console\Commands; |
18 | 18 | |
19 | 19 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | FileFinderBuilder::SORT_BY_NAME) |
62 | 62 | ->addOption('listFilesOnly', null, InputOption::VALUE_NONE, |
63 | 63 | 'Only list matched files and do not run analysis.') |
64 | - ->addArgument('filters', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Filter', ['name:*.php']); |
|
64 | + ->addArgument('filters', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Filter', [ 'name:*.php' ]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -133,16 +133,16 @@ discard block |
||
133 | 133 | $highestRequirement->getAnalysisTargetId())); |
134 | 134 | |
135 | 135 | if ($highestRequirement->count() !== 0) { |
136 | - $tableData = []; |
|
136 | + $tableData = [ ]; |
|
137 | 137 | // order by version->descending. Might want to implement ordering by line later. |
138 | 138 | foreach (array_reverse($highestRequirement->getRequirements()) as $version => $reasons) { |
139 | 139 | foreach ($reasons as $reason) { |
140 | - $tableData[] = [$reason['version'], $reason['msg'], $reason['line']]; |
|
140 | + $tableData[ ] = [ $reason[ 'version' ], $reason[ 'msg' ], $reason[ 'line' ] ]; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
144 | 144 | (new Table($out)) |
145 | - ->setHeaders(['Version', 'Message', 'Line']) |
|
145 | + ->setHeaders([ 'Version', 'Message', 'Line' ]) |
|
146 | 146 | ->setRows($tableData) |
147 | 147 | ->render(); |
148 | 148 | } else { |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | ' for the following reasons:', |
172 | 172 | PHP_EOL, |
173 | 173 | ]); |
174 | - $tableData = []; |
|
174 | + $tableData = [ ]; |
|
175 | 175 | /** @var $reason Reasoning */ |
176 | 176 | foreach ($result->getRequirementIterator() as $reason) { |
177 | - $tableData[] = [$reason['version'], $reason['msg'], $reason['line']]; |
|
177 | + $tableData[ ] = [ $reason[ 'version' ], $reason[ 'msg' ], $reason[ 'line' ] ]; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | (new Table($out)) |
181 | - ->setHeaders(['Version', 'Message', 'Line']) |
|
181 | + ->setHeaders([ 'Version', 'Message', 'Line' ]) |
|
182 | 182 | ->setRows($tableData) |
183 | 183 | ->render(); |
184 | 184 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ]); |
214 | 214 | $out->writeln(''); |
215 | 215 | |
216 | - $usedVersions = []; |
|
216 | + $usedVersions = [ ]; |
|
217 | 217 | /** @var AnalysisResult $result */ |
218 | 218 | foreach ($results as $result) { |
219 | 219 | $versions = array_keys($result->getRequirements()); |
@@ -222,12 +222,12 @@ discard block |
||
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
225 | - usort($usedVersions, function ($a, $b) { |
|
225 | + usort($usedVersions, function($a, $b) { |
|
226 | 226 | return version_compare($b, $a); |
227 | 227 | }); |
228 | 228 | |
229 | 229 | $table = new Table($out); |
230 | - $table->setHeaders(['Version', 'Message', 'Position']); |
|
230 | + $table->setHeaders([ 'Version', 'Message', 'Position' ]); |
|
231 | 231 | |
232 | 232 | foreach ($usedVersions as $index => $version) { |
233 | 233 | /** @var AnalysisResult $result */ |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | foreach ($selectedResults as $reason) { |
238 | 238 | $table->addRow([ |
239 | 239 | $version, |
240 | - $reason['msg'], |
|
241 | - $this->formatOutputPath($reason['targetId']) . ':' . $reason['line'], |
|
240 | + $reason[ 'msg' ], |
|
241 | + $this->formatOutputPath($reason[ 'targetId' ]) . ':' . $reason[ 'line' ], |
|
242 | 242 | ]); |
243 | 243 | } |
244 | 244 | } |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * DumpAstCommand.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 | + * DumpAstCommand.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\Console\Commands\Debug; |
18 | 18 | |
19 | 19 |