mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-08 12:20:52 +00:00
Post Nette tags split cleanup (#5925)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
This commit is contained in:
parent
b28b8742fc
commit
44375f6637
|
@ -152,8 +152,8 @@
|
|||
}
|
||||
},
|
||||
"config": {
|
||||
"platform-check": false,
|
||||
"sort-packages": true
|
||||
"sort-packages": true,
|
||||
"platform-check": false
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
|
|
|
@ -8,6 +8,7 @@ use PhpParser\Node\Stmt\Class_;
|
|||
use PHPStan\Type\ObjectType;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
|
||||
use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
use Rector\PHPUnit\PhpDoc\Node\PHPUnitDataProviderTagValueNode;
|
||||
|
||||
final class DataProviderMethodNamesResolver
|
||||
{
|
||||
|
@ -55,7 +56,7 @@ final class DataProviderMethodNamesResolver
|
|||
}
|
||||
|
||||
/**
|
||||
* @return \Rector\PHPUnit\PhpDoc\Node\PHPUnitDataProviderTagValueNode[]
|
||||
* @return PHPUnitDataProviderTagValueNode[]
|
||||
*/
|
||||
private function resolvePHPUnitDataProviderTagValueNodes(Class_ $class): array
|
||||
{
|
||||
|
@ -69,7 +70,7 @@ final class DataProviderMethodNamesResolver
|
|||
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
|
||||
|
||||
$foundPHPUnitDataProviderTagValueNodes = $phpDocInfo->findAllByType(
|
||||
\Rector\PHPUnit\PhpDoc\Node\PHPUnitDataProviderTagValueNode::class
|
||||
PHPUnitDataProviderTagValueNode::class
|
||||
);
|
||||
$phpunitDataProviderTagValueNodes = array_merge(
|
||||
$phpunitDataProviderTagValueNodes,
|
||||
|
|
|
@ -119,22 +119,6 @@ final class VariableNaming
|
|||
return null;
|
||||
}
|
||||
|
||||
private function resolveBareFuncCallArgumentName(FuncCall $funcCall, string $fallbackName, string $suffix): string
|
||||
{
|
||||
$argumentValue = $funcCall->args[0]->value;
|
||||
if ($argumentValue instanceof MethodCall || $argumentValue instanceof StaticCall) {
|
||||
$name = $this->nodeNameResolver->getName($argumentValue->name);
|
||||
} else {
|
||||
$name = $this->nodeNameResolver->getName($argumentValue);
|
||||
}
|
||||
|
||||
if ($name === null) {
|
||||
return $fallbackName;
|
||||
}
|
||||
|
||||
return $name . $suffix;
|
||||
}
|
||||
|
||||
private function unwrapNode(Node $node): ?Node
|
||||
{
|
||||
if ($node instanceof Arg) {
|
||||
|
|
|
@ -22,6 +22,7 @@ use Rector\NodeNameResolver\NodeNameResolver;
|
|||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
use Rector\NodeTypeResolver\TypeAnalyzer\StringTypeAnalyzer;
|
||||
use Rector\PHPUnit\PhpDoc\Node\PHPUnitDoesNotPerformAssertionTagNode;
|
||||
use Rector\PostRector\Collector\NodesToAddCollector;
|
||||
use Rector\PostRector\Collector\NodesToRemoveCollector;
|
||||
|
||||
|
@ -274,7 +275,7 @@ final class AssertManipulator
|
|||
}
|
||||
|
||||
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
|
||||
$phpDocInfo->addPhpDocTagNode(new \Rector\PHPUnit\PhpDoc\Node\PHPUnitDoesNotPerformAssertionTagNode());
|
||||
$phpDocInfo->addPhpDocTagNode(new PHPUnitDoesNotPerformAssertionTagNode());
|
||||
}
|
||||
|
||||
private function renameAssertMethod(StaticCall $staticCall): void
|
||||
|
|
|
@ -13,6 +13,7 @@ use PHPStan\Type\ObjectType;
|
|||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\SymfonyRequiredTagNode;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDocNode\ApiPhpDocTagNode;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Nette\PhpDoc\Node\NetteInjectTagNode;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\VendorLocker\NodeVendorLocker\PropertyVisibilityVendorLockResolver;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
|
@ -31,7 +32,7 @@ final class PrivatizeLocalPropertyToPrivatePropertyRector extends AbstractRector
|
|||
// Symfony DI
|
||||
SymfonyRequiredTagNode::class,
|
||||
// other DI
|
||||
\Rector\Nette\PhpDoc\Node\NetteInjectTagNode::class,
|
||||
NetteInjectTagNode::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ final class RectorContainerFactory
|
|||
|
||||
// mt_rand is needed to invalidate container cache in case of class changes to be registered as services
|
||||
$isPHPUnitRun = StaticPHPUnitEnvironment::isPHPUnitRun();
|
||||
if ($isPHPUnitRun === false) {
|
||||
if (! $isPHPUnitRun) {
|
||||
$environment .= mt_rand(0, 10000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user