mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Renamed NoParticularNodeRule to ForbiddenNodeRule (#4848)
Co-authored-by: rector-bot <tomas@getrector.org>
This commit is contained in:
parent
21e5a6696c
commit
ff2ea86176
@ -29,15 +29,15 @@
|
||||
"symfony/dependency-injection": "^4.4.8|^5.1",
|
||||
"symfony/finder": "^4.4.8|^5.1",
|
||||
"symfony/http-kernel": "^4.4.8|^5.1",
|
||||
"symplify/autowire-array-parameter": "^9.0.1",
|
||||
"symplify/skipper": "^9.0.1",
|
||||
"symplify/package-builder": "^9.0.1",
|
||||
"symplify/simple-php-doc-parser": "^9.0.1",
|
||||
"symplify/smart-file-system": "^9.0.1",
|
||||
"symplify/rule-doc-generator": "^9.0.1",
|
||||
"symplify/set-config-resolver": "^9.0.1",
|
||||
"symplify/console-color-diff": "^9.0.1",
|
||||
"symplify/symfony-php-config": "^9.0.1",
|
||||
"symplify/autowire-array-parameter": "^9.0.3",
|
||||
"symplify/skipper": "^9.0.3",
|
||||
"symplify/package-builder": "^9.0.3",
|
||||
"symplify/simple-php-doc-parser": "^9.0.3",
|
||||
"symplify/smart-file-system": "^9.0.3",
|
||||
"symplify/rule-doc-generator": "^9.0.3",
|
||||
"symplify/set-config-resolver": "^9.0.3",
|
||||
"symplify/console-color-diff": "^9.0.3",
|
||||
"symplify/symfony-php-config": "^9.0.3",
|
||||
"webmozart/assert": "^1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
@ -49,12 +49,12 @@
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"phpunit/phpunit": "^8.5|^9.2",
|
||||
"psr/event-dispatcher": "^1.0",
|
||||
"symplify/changelog-linker": "^9.0.1",
|
||||
"symplify/easy-coding-standard": "^9.0.1",
|
||||
"symplify/coding-standard": "^9.0.1",
|
||||
"symplify/easy-testing": "^9.0.1",
|
||||
"symplify/phpstan-extensions": "^9.0.1",
|
||||
"symplify/phpstan-rules": "^9.0.1",
|
||||
"symplify/changelog-linker": "^9.0.3",
|
||||
"symplify/easy-coding-standard": "^9.0.3",
|
||||
"symplify/coding-standard": "^9.0.3",
|
||||
"symplify/easy-testing": "^9.0.3",
|
||||
"symplify/phpstan-extensions": "^9.0.3",
|
||||
"symplify/phpstan-rules": "^9.0.3",
|
||||
"tracy/tracy": "^2.7"
|
||||
},
|
||||
"replace": {
|
||||
|
@ -31,7 +31,7 @@ services:
|
||||
- getRectorsWithConfiguration
|
||||
|
||||
-
|
||||
class: Symplify\PHPStanRules\Rules\NoParticularNodeRule
|
||||
class: Symplify\PHPStanRules\Rules\ForbiddenNodeRule
|
||||
tags: [phpstan.rules.rule]
|
||||
arguments:
|
||||
forbiddenNodes:
|
||||
|
@ -171,7 +171,7 @@ CODE_SAMPLE
|
||||
$classMethods = $this->getPublicMethods($className);
|
||||
$interfaceMethods = $this->getPublicMethods($interfaceName);
|
||||
|
||||
return count(array_diff($classMethods, $interfaceMethods)) > 0;
|
||||
return array_diff($classMethods, $interfaceMethods) !== [];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,13 +181,13 @@ CODE_SAMPLE
|
||||
*/
|
||||
private function getPublicMethods(string $fqcn): array
|
||||
{
|
||||
$reflection = new ReflectionClass($fqcn);
|
||||
$reflectionClass = new ReflectionClass($fqcn);
|
||||
|
||||
return array_map(
|
||||
static function (ReflectionMethod $method) {
|
||||
static function (ReflectionMethod $method): string {
|
||||
return $method->name;
|
||||
},
|
||||
$reflection->getMethods(ReflectionMethod::IS_PUBLIC)
|
||||
$reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user