Skip to content

Commit 5801f54

Browse files
committed
Extend Phan analysis
1 parent 275cb9d commit 5801f54

9 files changed

+12
-7
lines changed

Diff for: .phan/config.php

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'directory_list' => [
2323
'MO4',
2424
'tests',
25+
'vendor/squizlabs/php_codesniffer',
2526
],
2627

2728
// A directory list that defines files that will be excluded

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ script:
3131
- vendor/bin/phpcs # Stylecheck against PHPCS's ruleset
3232
- vendor/bin/phpstan analyse --no-progress # Run PHPStan
3333
- vendor/bin/psalm --show-info=false # run psalm
34-
- if [ "${DEPENDENCIES}" = "highest" ]; then vendor/bin/phan -i; fi; # Run phan
34+
- if [ "${DEPENDENCIES}" = "highest" ]; then vendor/bin/phan; fi; # Run phan
3535
- if [ "${TRAVIS_PHP_VERSION}" != "7.3" ]; then php -d zend_extension=xdebug.so vendor/bin/phpunit --coverage-clover=coverage.xml; fi; # Generate Code coverage report
3636

3737
jobs:

Diff for: MO4/Library/PregLibrary.php

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class PregLibrary
3434
* @return string[]|array[]
3535
*
3636
* @throws RuntimeException
37+
*
38+
* @psalm-suppress ArgumentTypeCoercion
3739
*/
3840
public static function mo4_preg_split($pattern, $subject, $limit=-1, $flags=0): array
3941
{

Diff for: MO4/Sniffs/Arrays/ArrayDoubleArrowAlignmentSniff.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ class ArrayDoubleArrowAlignmentSniff implements Sniff
3434
* @var array
3535
*/
3636
protected $arrayTokens = [
37-
T_ARRAY,
37+
// @phan-suppress-next-line PhanUndeclaredConstant
3838
T_OPEN_SHORT_ARRAY,
39+
T_ARRAY,
3940
];
4041

4142

Diff for: MO4/Sniffs/Arrays/MultiLineArraySniff.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ class MultiLineArraySniff implements Sniff
3131
* @var array
3232
*/
3333
protected $arrayTokens = [
34-
T_ARRAY,
34+
// @phan-suppress-next-line PhanUndeclaredConstant
3535
T_OPEN_SHORT_ARRAY,
36+
T_ARRAY,
3637
];
3738

3839

Diff for: MO4/Sniffs/Commenting/PropertyCommentSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected function processTokenWithinScope(
218218
$commentStart = $phpcsFile->findPrevious(
219219
T_COMMENT,
220220
$commentEnd,
221-
null,
221+
0,
222222
true
223223
);
224224
$phpcsFile->addError(

Diff for: MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private function checkIsNonImportUse(File $phpcsFile, int $stackPtr): bool
234234
$prev = $phpcsFile->findPrevious(
235235
PHP_CodeSniffer_Tokens::$emptyTokens,
236236
($stackPtr - 1),
237-
null,
237+
0,
238238
true,
239239
null,
240240
true

Diff for: MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ protected function getUseStatements(
245245
$aliasNamePtr = $phpcsFile->findPrevious(
246246
PHP_CodeSniffer_Tokens::$emptyTokens,
247247
($useEnd - 1),
248-
null,
248+
0,
249249
true
250250
);
251251

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"dealerdirect/phpcodesniffer-composer-installer": "~0.7",
3434
"escapestudios/symfony2-coding-standard": "^3.10.0",
3535
"slevomat/coding-standard": "^6.2.0",
36-
"squizlabs/php_codesniffer": "^3.5.4"
36+
"squizlabs/php_codesniffer": "^3.5.8"
3737
}
3838
}

0 commit comments

Comments
 (0)