diff --git a/.travis.yml b/.travis.yml index cde8501..d4397a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ php: - '7.1' - '7.2' - '7.3' + - '7.4' env: global: @@ -20,8 +21,6 @@ cache: directories: - $HOME/.composer/cache/files -before_install: composer self-update - before_install: - composer self-update - if [ -x .travis/before_install_${TARGET}.sh ]; then .travis/before_install_${TARGET}.sh; fi; @@ -34,4 +33,3 @@ script: after_success: - if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; - diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c63a9..823f7a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ master * todo... +v0.3.0 +------ + +* Updated to PHPStan 0.12 +* Added testing on PHP 7.4 + v0.2.0 ------ diff --git a/README.md b/README.md index 7c08b9c..24ce8b4 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,17 @@ parameters: # enable detection of echo - type: Stmt_Echo + functions: null # enable detection of eval - type: Expr_Eval + functions: null # enable detection of die/exit - type: Expr_Exit + functions: null # enable detection of a set of functions - diff --git a/composer.json b/composer.json index cd90339..3c04719 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,12 @@ ], "require": { "php": "^7.1", - "phpstan/phpstan": "^0.11" + "phpstan/phpstan": "^0.12" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.12", "localheinz/composer-normalize": "^1.3", - "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-phpunit": "^0.12", "phpunit/phpunit": "^7.2", "sensiolabs/security-checker": "^5.0", "symfony/var-dumper": "^4.3" diff --git a/extension.neon b/extension.neon index bb5502a..d9b9521 100644 --- a/extension.neon +++ b/extension.neon @@ -1,17 +1,29 @@ +parametersSchema: + banned_code: structure([ + nodes: listOf(structure([ + type: string() + functions: schema(listOf(string()), nullable()) + ])) + use_from_tests: bool() + ]) + parameters: banned_code: nodes: # enable detection of echo - type: Stmt_Echo + functions: null # enable detection of eval - type: Expr_Eval + functions: null # enable detection of die/exit - type: Expr_Exit + functions: null # enable detection of a set of functions - diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3c99afd..56fa056 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,3 +1,6 @@ +parameters: + checkGenericClassInNonGenericObjectType: false + includes: - extension.neon - vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/src/Rules/BannedNodesRule.php b/src/Rules/BannedNodesRule.php index 2e3eb0c..95853d8 100644 --- a/src/Rules/BannedNodesRule.php +++ b/src/Rules/BannedNodesRule.php @@ -26,12 +26,12 @@ class BannedNodesRule implements Rule { /** - * @var array + * @var array> */ private $bannedNodes; /** - * @param array $bannedNodes + * @param array> $bannedNodes */ public function __construct(array $bannedNodes) { diff --git a/tests/Rules/BannedNodesRuleTest.php b/tests/Rules/BannedNodesRuleTest.php index 45d32cc..4a1294f 100644 --- a/tests/Rules/BannedNodesRuleTest.php +++ b/tests/Rules/BannedNodesRuleTest.php @@ -120,7 +120,7 @@ public function testProcessNodeWithHandledTypes(Expr $node): void } /** - * @return \Generator + * @return \Generator> */ public function getUnhandledNodes(): \Generator { @@ -128,7 +128,7 @@ public function getUnhandledNodes(): \Generator } /** - * @return \Generator + * @return \Generator> */ public function getHandledNodes(): \Generator {