Skip to content

Commit

Permalink
Extend Phan analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Oct 23, 2020
1 parent 275cb9d commit fdd75a4
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'directory_list' => [
'MO4',
'tests',
'vendor/squizlabs/php_codesniffer',
],

// A directory list that defines files that will be excluded
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ script:
- vendor/bin/phpcs # Stylecheck against PHPCS's ruleset
- vendor/bin/phpstan analyse --no-progress # Run PHPStan
- vendor/bin/psalm --show-info=false # run psalm
- if [ "${DEPENDENCIES}" = "highest" ]; then vendor/bin/phan -i; fi; # Run phan
- if [ "${DEPENDENCIES}" = "highest" ]; then vendor/bin/phan; fi; # Run phan
- 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

jobs:
Expand Down
2 changes: 2 additions & 0 deletions MO4/Library/PregLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class PregLibrary
* @return string[]|array[]
*
* @throws RuntimeException
*
* @psalm-suppress ArgumentTypeCoercion
*/
public static function mo4_preg_split($pattern, $subject, $limit=-1, $flags=0): array
{
Expand Down
3 changes: 2 additions & 1 deletion MO4/Sniffs/Arrays/ArrayDoubleArrowAlignmentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ class ArrayDoubleArrowAlignmentSniff implements Sniff
* @var array
*/
protected $arrayTokens = [
T_ARRAY,
// @phan-suppress-next-line PhanUndeclaredConstant
T_OPEN_SHORT_ARRAY,
T_ARRAY,
];


Expand Down
3 changes: 2 additions & 1 deletion MO4/Sniffs/Arrays/MultiLineArraySniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class MultiLineArraySniff implements Sniff
* @var array
*/
protected $arrayTokens = [
T_ARRAY,
// @phan-suppress-next-line PhanUndeclaredConstant
T_OPEN_SHORT_ARRAY,
T_ARRAY,
];


Expand Down
2 changes: 1 addition & 1 deletion MO4/Sniffs/Commenting/PropertyCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ protected function processTokenWithinScope(
$commentStart = $phpcsFile->findPrevious(
T_COMMENT,
$commentEnd,
null,
0,
true
);
$phpcsFile->addError(
Expand Down
2 changes: 1 addition & 1 deletion MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private function checkIsNonImportUse(File $phpcsFile, int $stackPtr): bool
$prev = $phpcsFile->findPrevious(
PHP_CodeSniffer_Tokens::$emptyTokens,
($stackPtr - 1),
null,
0,
true,
null,
true
Expand Down
2 changes: 1 addition & 1 deletion MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ protected function getUseStatements(
$aliasNamePtr = $phpcsFile->findPrevious(
PHP_CodeSniffer_Tokens::$emptyTokens,
($useEnd - 1),
null,
0,
true
);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"dealerdirect/phpcodesniffer-composer-installer": "~0.7",
"escapestudios/symfony2-coding-standard": "^3.10.0",
"slevomat/coding-standard": "^6.2.0",
"squizlabs/php_codesniffer": "^3.5.4"
"squizlabs/php_codesniffer": "^3.5.8"
}
}

0 comments on commit fdd75a4

Please sign in to comment.