Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#5665)
Browse files Browse the repository at this point in the history
Co-authored-by: TomasVotruba <[email protected]>
  • Loading branch information
TomasVotruba and TomasVotruba authored Feb 25, 2024
1 parent 74a7c51 commit 58abec4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion rules/Php71/Rector/Assign/AssignArrayToStringRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\Php71\Rector\Assign;

use PHPStan\Type\UnionType;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
Expand All @@ -19,6 +18,7 @@
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Property;
use PhpParser\NodeTraverser;
use PHPStan\Type\UnionType;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Rector\PhpParser\NodeFinder\PropertyFetchFinder;
use Rector\Rector\AbstractRector;
Expand Down
2 changes: 1 addition & 1 deletion rules/Php83/Rector/ClassConst/AddTypeToConstRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ private function getParentReflections(string $className): array

private function canBeInherited(ClassConst $classConst, Class_ $class): bool
{
return ! $class->isFinal() && ! $classConst->isPrivate() && !$classConst->isFinal();
return ! $class->isFinal() && ! $classConst->isPrivate() && ! $classConst->isFinal();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ public function getRuleDefinition(): RuleDefinition
return new RuleDefinition(
'Rename param within closures and arrow functions based on use with specified method calls',
[
new ConfiguredCodeSample(
<<<'CODE_SAMPLE'
new ConfiguredCodeSample(
<<<'CODE_SAMPLE'
(new SomeClass)->process(function ($param) {});
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
,
<<<'CODE_SAMPLE'
(new SomeClass)->process(function ($parameter) {});
CODE_SAMPLE
,
[new RenameFunctionLikeParamWithinCallLikeArg('SomeClass', 'process', 0, 0, 'parameter')]
),

]);
,
[new RenameFunctionLikeParamWithinCallLikeArg('SomeClass', 'process', 0, 0, 'parameter')]
),

]
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace Rector\TypeDeclaration\Rector\Property;

use PHPStan\Type\ObjectType;
use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\IntersectionTypeNode;
use PHPStan\Type\ObjectType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\ValueObject\Type\FullyQualifiedIdentifierTypeNode;
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
Expand Down Expand Up @@ -125,7 +125,7 @@ public function refactor(Node $node): ?Node
if ($varTag instanceof VarTagValueNode && $varType instanceof ObjectType && $varType->getClassName() !== 'PHPUnit\Framework\MockObject\MockObject') {
$varTag->type = new IntersectionTypeNode([
new FullyQualifiedIdentifierTypeNode($propertyType->getClassName()),
new FullyQualifiedIdentifierTypeNode($varType->getClassName())
new FullyQualifiedIdentifierTypeNode($varType->getClassName()),
]);
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($property);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Rector\BetterPhpDocParser\PhpDocParser;

use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
use PhpParser\Node as PhpNode;
use PHPStan\PhpDocParser\Ast\Node;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode;
use Rector\BetterPhpDocParser\Contract\PhpDocParser\PhpDocNodeDecoratorInterface;
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
use Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser;
use Rector\StaticTypeMapper\Naming\NameScopeFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpParser/Printer/BetterStandardPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Rector\PhpParser\Printer;

use PhpParser\Node\AttributeGroup;
use Nette\Utils\Strings;
use PhpParser\Comment;
use PhpParser\Node;
use PhpParser\Node\AttributeGroup;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrowFunction;
Expand Down

0 comments on commit 58abec4

Please sign in to comment.