mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
use filesytem utils package name
This commit is contained in:
parent
86bcb6eb7b
commit
187bcd92eb
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -13,7 +13,6 @@ create-rector.yaml
|
|||
|
||||
# tests - travis
|
||||
/laravel-dir
|
||||
/utils
|
||||
|
||||
# compiler
|
||||
/compiler/composer.lock
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
"Rector\\NetteToSymfony\\Tests\\": "rules/nette-to-symfony/tests",
|
||||
"Rector\\Nette\\Tests\\": "packages/nette/tests",
|
||||
"Rector\\NodeTypeResolver\\Tests\\": "packages/node-type-resolver/tests",
|
||||
"Rector\\PHPStanExtensions\\": "utils/PHPStanExtensions/src",
|
||||
"Rector\\PHPStanExtensions\\": "utils/phpstan-extensions/src",
|
||||
"Rector\\PHPStan\\Tests\\": "rules/phpstan/tests",
|
||||
"Rector\\PHPUnitSymfony\\Tests\\": "rules/phpunit-symfony/tests",
|
||||
"Rector\\PHPUnit\\Tests\\": "rules/phpunit/tests",
|
||||
|
@ -178,9 +178,9 @@
|
|||
"Rector\\DynamicTypeAnalysis\\Tests\\": "packages/dynamic-type-analysis/tests",
|
||||
"Rector\\PhpDeglobalize\\Tests\\": "rules/php-deglobalize/tests",
|
||||
"Rector\\Phalcon\\Tests\\": "rules/phalcon/tests",
|
||||
"Rector\\Utils\\DocumentationGenerator\\": "utils/DocumentationGenerator/src",
|
||||
"Rector\\Utils\\PHPStanAttributeTypeSyncer\\": "utils/PHPStanAttributeTypeSyncer/src",
|
||||
"Rector\\Utils\\PHPStanStaticTypeMapperChecker\\": "utils/PHPStanStaticTypeMapperChecker/src",
|
||||
"Rector\\Utils\\DocumentationGenerator\\": "utils/documentation-generator/src",
|
||||
"Rector\\Utils\\PHPStanAttributeTypeSyncer\\": "utils/phpstan-attribute-type-syncer/src",
|
||||
"Rector\\Utils\\PHPStanStaticTypeMapperChecker\\": "utils/phpstan-static-type-mapper-checker/src",
|
||||
"Rector\\DoctrineGedmoToKnplabs\\Tests\\": "rules/doctrine-gedmo-to-knplabs/tests",
|
||||
"Rector\\MinimalScope\\Tests\\": "rules/minimal-scope/tests",
|
||||
"Rector\\Polyfill\\Tests\\": "packages/polyfill/tests",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
includes:
|
||||
- 'utils/PHPStanExtensions/config/phpstan-extensions.neon'
|
||||
- 'utils/phpstan-extensions/config/phpstan-extensions.neon'
|
||||
- 'vendor/symplify/phpstan-extensions/config/config.neon'
|
||||
- 'vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon'
|
||||
- 'vendor/phpstan/phpstan/conf/bleedingEdge.neon'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
services:
|
||||
- { class: Rector\PHPStanExtensions\Rule\ClassMethod\PreventParentMethodVisibilityOverrideRule, tags: [phpstan.rules.rule] }
|
||||
- { class: Rector\PHPStanExtensions\Rule\ClassLike\KeepRectorNamespaceForRectorRule, tags: [phpstan.rules.rule] }
|
||||
|
||||
- Rector\PHPStanExtensions\Utils\PHPStanValueResolver
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\PHPStanExtensions\Rule\ClassLike;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Rules\Rule;
|
||||
use PHPStan\Rules\RuleError;
|
||||
use PHPStan\Rules\RuleErrors\RuleErrorWithMessageAndLineAndFile;
|
||||
use Rector\Exception\NotImplementedException;
|
||||
use ReflectionMethod;
|
||||
|
||||
final class KeepRectorNamespaceForRectorRule implements Rule
|
||||
{
|
||||
public function getNodeType(): string
|
||||
{
|
||||
return ClassLike::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ClassLike $node
|
||||
* @return RuleError[]
|
||||
*/
|
||||
public function processNode(Node $node, Scope $scope): array
|
||||
{
|
||||
$classLikeName =$node->name->toString();
|
||||
$scope->getNamespace
|
||||
|
||||
// $ruleError = new RuleErrorWithMessageAndLineAndFile(
|
||||
// sprintf(
|
||||
// 'Change "%s()" method visibility to "%s" to respect parent method visibility.',
|
||||
// $methodName,
|
||||
// $methodVisibility
|
||||
// ),
|
||||
// $node->getLine(),
|
||||
// $scope->getFile()
|
||||
// );
|
||||
//
|
||||
// return [$ruleError];
|
||||
// }
|
||||
//
|
||||
// return [];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user