mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
Updated Rector to commit b3480900f3
b3480900f3
[CodingStyle] Remove YieldClassMethodToArrayClassMethodRector, rather PHPStorm job (#576)
This commit is contained in:
parent
0f5395c1ad
commit
1452c5d9ff
|
@ -4,14 +4,14 @@ declare (strict_types=1);
|
|||
namespace RectorPrefix20210802;
|
||||
|
||||
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
|
||||
use Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector;
|
||||
use Rector\CodeQuality\Rector\Variable\MoveVariableDeclarationNearReferenceRector;
|
||||
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
|
||||
use Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(\Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class);
|
||||
$services->set(\Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector::class);
|
||||
$services->set(\Rector\CodeQuality\Rector\Variable\MoveVariableDeclarationNearReferenceRector::class);
|
||||
$services->set(\Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector::class);
|
||||
$services->set(\Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# 476 Rules Overview
|
||||
# 475 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
|
||||
- [CodeQualityStrict](#codequalitystrict) (1)
|
||||
|
||||
- [CodingStyle](#codingstyle) (39)
|
||||
- [CodingStyle](#codingstyle) (38)
|
||||
|
||||
- [Composer](#composer) (6)
|
||||
|
||||
|
@ -2375,7 +2375,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(ReturnArrayClassMethodToYieldRector::class)
|
||||
->call('configure', [[
|
||||
ReturnArrayClassMethodToYieldRector::METHODS_TO_YIELDS => ValueObjectInliner::inline([
|
||||
new ReturnArrayClassMethodToYield('EventSubscriberInterface', 'getSubscribedEvents'),
|
||||
new ReturnArrayClassMethodToYield('PHPUnit\Framework\TestCase', '*provide*'),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
@ -2384,12 +2384,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
↓
|
||||
|
||||
```diff
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest implements TestCase
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
public static function provideData()
|
||||
{
|
||||
- return ['event' => 'callback'];
|
||||
+ yield 'event' => 'callback';
|
||||
- return [['some text']];
|
||||
+ yield ['some text'];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -2670,45 +2672,6 @@ Wrap encapsed variables in curly braces
|
|||
|
||||
<br>
|
||||
|
||||
### YieldClassMethodToArrayClassMethodRector
|
||||
|
||||
Turns yield return to array return in specific type and method
|
||||
|
||||
:wrench: **configure it!**
|
||||
|
||||
- class: [`Rector\CodingStyle\Rector\ClassMethod\YieldClassMethodToArrayClassMethodRector`](../rules/CodingStyle/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector.php)
|
||||
|
||||
```php
|
||||
use Rector\CodingStyle\Rector\ClassMethod\YieldClassMethodToArrayClassMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(YieldClassMethodToArrayClassMethodRector::class)
|
||||
->call('configure', [[
|
||||
YieldClassMethodToArrayClassMethodRector::METHODS_BY_TYPE => [
|
||||
'EventSubscriberInterface' => ['getSubscribedEvents'],
|
||||
|
||||
], ]]);
|
||||
};
|
||||
```
|
||||
|
||||
↓
|
||||
|
||||
```diff
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
- yield 'event' => 'callback';
|
||||
+ return ['event' => 'callback'];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## Composer
|
||||
|
||||
### AddPackageToRequireComposerRector
|
||||
|
|
|
@ -5,10 +5,13 @@ namespace Rector\NodeTypeResolver\Contract;
|
|||
|
||||
use PhpParser\Node;
|
||||
use PHPStan\Type\Type;
|
||||
/**
|
||||
* @template TNode as Node
|
||||
*/
|
||||
interface NodeTypeResolverInterface
|
||||
{
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
* @return array<class-string<TNode>>
|
||||
*/
|
||||
public function getNodeClasses() : array;
|
||||
/**
|
||||
|
|
|
@ -36,13 +36,13 @@ final class PropertyTypeResolver implements \Rector\NodeTypeResolver\Contract\No
|
|||
return [\PhpParser\Node\Stmt\Property::class];
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node $propertyNode
|
||||
* @param \PhpParser\Node $node
|
||||
*/
|
||||
public function resolve($propertyNode) : \PHPStan\Type\Type
|
||||
public function resolve($node) : \PHPStan\Type\Type
|
||||
{
|
||||
// fake property to local PropertyFetch → PHPStan understands that
|
||||
$propertyFetch = new \PhpParser\Node\Expr\PropertyFetch(new \PhpParser\Node\Expr\Variable('this'), (string) $propertyNode->props[0]->name);
|
||||
$propertyFetch->setAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, $propertyNode->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE));
|
||||
$propertyFetch = new \PhpParser\Node\Expr\PropertyFetch(new \PhpParser\Node\Expr\Variable('this'), (string) $node->props[0]->name);
|
||||
$propertyFetch->setAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE));
|
||||
return $this->nodeTypeResolver->resolve($propertyFetch);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,11 +32,11 @@ final class TraitTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeT
|
|||
return [\PhpParser\Node\Stmt\Trait_::class];
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node $traitNode
|
||||
* @param \PhpParser\Node $node
|
||||
*/
|
||||
public function resolve($traitNode) : \PHPStan\Type\Type
|
||||
public function resolve($node) : \PHPStan\Type\Type
|
||||
{
|
||||
$traitName = (string) $traitNode->namespacedName;
|
||||
$traitName = (string) $node->namespacedName;
|
||||
if (!$this->reflectionProvider->hasClass($traitName)) {
|
||||
return new \PHPStan\Type\MixedType();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ interface TypeMapperInterface
|
|||
/**
|
||||
* @param \PHPStan\Type\Type $type
|
||||
* @return Name|NullableType|UnionType|null
|
||||
* @param \Rector\PHPStanStaticTypeMapper\ValueObject\TypeKind $typeTypeKind
|
||||
* @param \Rector\PHPStanStaticTypeMapper\ValueObject\TypeKind $typeKind
|
||||
*/
|
||||
public function mapToPhpParserNode($type, $typeTypeKind) : ?\PhpParser\Node;
|
||||
public function mapToPhpParserNode($type, $typeKind) : ?\PhpParser\Node;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\CodeQualityStrict\Rector\Variable;
|
||||
namespace Rector\CodeQuality\Rector\Variable;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
|
@ -17,20 +17,16 @@ use PhpParser\Node\Stmt\Expression;
|
|||
use PhpParser\Node\Stmt\For_;
|
||||
use PhpParser\Node\Stmt\Foreach_;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\InlineHTML;
|
||||
use PhpParser\Node\Stmt\Switch_;
|
||||
use PhpParser\Node\Stmt\TryCatch;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\DeadCode\SideEffect\SideEffectNodeDetector;
|
||||
use Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder;
|
||||
use Rector\NodeNestingScope\ParentFinder;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector\MoveVariableDeclarationNearReferenceRectorTest
|
||||
* @see \Rector\Tests\CodeQuality\Rector\Variable\MoveVariableDeclarationNearReferenceRector\MoveVariableDeclarationNearReferenceRectorTest
|
||||
*/
|
||||
final class MoveVariableDeclarationNearReferenceRector extends \Rector\Core\Rector\AbstractRector
|
||||
{
|
||||
|
@ -38,24 +34,19 @@ final class MoveVariableDeclarationNearReferenceRector extends \Rector\Core\Rect
|
|||
* @var \Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder
|
||||
*/
|
||||
private $scopeAwareNodeFinder;
|
||||
/**
|
||||
* @var \Rector\DeadCode\SideEffect\SideEffectNodeDetector
|
||||
*/
|
||||
private $sideEffectNodeDetector;
|
||||
/**
|
||||
* @var \PHPStan\Reflection\ReflectionProvider
|
||||
*/
|
||||
private $reflectionProvider;
|
||||
/**
|
||||
* @var \Rector\NodeNestingScope\ParentFinder
|
||||
*/
|
||||
private $parentFinder;
|
||||
public function __construct(\Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder $scopeAwareNodeFinder, \Rector\DeadCode\SideEffect\SideEffectNodeDetector $sideEffectNodeDetector, \PHPStan\Reflection\ReflectionProvider $reflectionProvider, \Rector\NodeNestingScope\ParentFinder $parentFinder)
|
||||
/**
|
||||
* @var \Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder
|
||||
*/
|
||||
private $usageInNextStmtFinder;
|
||||
public function __construct(\Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder $scopeAwareNodeFinder, \Rector\NodeNestingScope\ParentFinder $parentFinder, \Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder $usageInNextStmtFinder)
|
||||
{
|
||||
$this->scopeAwareNodeFinder = $scopeAwareNodeFinder;
|
||||
$this->sideEffectNodeDetector = $sideEffectNodeDetector;
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
$this->parentFinder = $parentFinder;
|
||||
$this->usageInNextStmtFinder = $usageInNextStmtFinder;
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
|
@ -99,18 +90,16 @@ CODE_SAMPLE
|
|||
if ($this->isUsedAsArraykeyOrInsideIfCondition($expression, $node)) {
|
||||
return null;
|
||||
}
|
||||
if ($this->hasPropertyInExpr($expression, $parent->expr)) {
|
||||
if ($this->hasPropertyInExpr($parent->expr)) {
|
||||
return null;
|
||||
}
|
||||
if ($this->shouldSkipReAssign($expression, $parent)) {
|
||||
return null;
|
||||
}
|
||||
$variable = $this->getUsageInNextStmts($expression, $node);
|
||||
if (!$variable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
$usageStmt = $this->findUsageStmt($expression, $node);
|
||||
if (!$usageStmt instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
/** @var Node $usageStmt */
|
||||
$usageStmt = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT);
|
||||
if ($this->isInsideLoopStmts($usageStmt)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -126,7 +115,7 @@ CODE_SAMPLE
|
|||
}
|
||||
return $this->isInsideCondition($expression);
|
||||
}
|
||||
private function hasPropertyInExpr(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr $expr) : bool
|
||||
private function hasPropertyInExpr(\PhpParser\Node\Expr $expr) : bool
|
||||
{
|
||||
return (bool) $this->betterNodeFinder->findFirst($expr, function (\PhpParser\Node $node) : bool {
|
||||
return $node instanceof \PhpParser\Node\Expr\PropertyFetch || $node instanceof \PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
|
@ -139,32 +128,6 @@ CODE_SAMPLE
|
|||
}
|
||||
return $this->hasReAssign($expression, $assign->expr);
|
||||
}
|
||||
private function getUsageInNextStmts(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
/** @var Node|null $next */
|
||||
$next = $expression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
if (!$next instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
if ($next instanceof \PhpParser\Node\Stmt\InlineHTML) {
|
||||
return null;
|
||||
}
|
||||
if ($this->hasCall($next)) {
|
||||
return null;
|
||||
}
|
||||
$countFound = $this->getCountFound($next, $variable);
|
||||
if ($countFound === 0) {
|
||||
return null;
|
||||
}
|
||||
if ($countFound >= 2) {
|
||||
return null;
|
||||
}
|
||||
$nextVariable = $this->getSameVarName([$next], $variable);
|
||||
if ($nextVariable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $nextVariable;
|
||||
}
|
||||
return $this->getSameVarNameInNexts($next, $variable);
|
||||
}
|
||||
private function isInsideLoopStmts(\PhpParser\Node $node) : bool
|
||||
{
|
||||
$loopNode = $this->parentFinder->findByTypes($node, [\PhpParser\Node\Stmt\For_::class, \PhpParser\Node\Stmt\While_::class, \PhpParser\Node\Stmt\Foreach_::class, \PhpParser\Node\Stmt\Do_::class]);
|
||||
|
@ -224,63 +187,6 @@ CODE_SAMPLE
|
|||
}
|
||||
return \false;
|
||||
}
|
||||
private function hasCall(\PhpParser\Node $node) : bool
|
||||
{
|
||||
return (bool) $this->betterNodeFinder->findFirst($node, function (\PhpParser\Node $n) : bool {
|
||||
return $this->sideEffectNodeDetector->detectCallExpr($n);
|
||||
});
|
||||
}
|
||||
private function getCountFound(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : int
|
||||
{
|
||||
$countFound = 0;
|
||||
while ($node) {
|
||||
$isFound = (bool) $this->getSameVarName([$node], $variable);
|
||||
if ($isFound) {
|
||||
++$countFound;
|
||||
}
|
||||
$countFound = $this->countWithElseIf($node, $variable, $countFound);
|
||||
$countFound = $this->countWithTryCatch($node, $variable, $countFound);
|
||||
$countFound = $this->countWithSwitchCase($node, $variable, $countFound);
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
/**
|
||||
* @param array<int, Node|null> $multiNodes
|
||||
*/
|
||||
private function getSameVarName(array $multiNodes, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
foreach ($multiNodes as $multiNode) {
|
||||
if ($multiNode === null) {
|
||||
continue;
|
||||
}
|
||||
/** @var Variable|null $found */
|
||||
$found = $this->betterNodeFinder->findFirst($multiNode, function (\PhpParser\Node $n) use($variable) : bool {
|
||||
$n = $this->mayBeArrayDimFetch($n);
|
||||
if (!$n instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return \false;
|
||||
}
|
||||
return $this->isName($n, (string) $this->getName($variable));
|
||||
});
|
||||
if ($found !== null) {
|
||||
return $found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function getSameVarNameInNexts(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
while ($node) {
|
||||
$found = $this->getSameVarName([$node], $variable);
|
||||
if ($found instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $found;
|
||||
}
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function mayBeArrayDimFetch(\PhpParser\Node $node) : \PhpParser\Node
|
||||
{
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
|
@ -289,39 +195,15 @@ CODE_SAMPLE
|
|||
}
|
||||
return $node;
|
||||
}
|
||||
private function countWithElseIf(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
/**
|
||||
* @return \PhpParser\Node|null
|
||||
*/
|
||||
private function findUsageStmt(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable)
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\If_) {
|
||||
return $countFound;
|
||||
$nextVariable = $this->usageInNextStmtFinder->getUsageInNextStmts($expression, $variable);
|
||||
if (!$nextVariable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return null;
|
||||
}
|
||||
$isFoundElseIf = (bool) $this->getSameVarName($node->elseifs, $variable);
|
||||
$isFoundElse = (bool) $this->getSameVarName([$node->else], $variable);
|
||||
if ($isFoundElseIf || $isFoundElse) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithTryCatch(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\TryCatch) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCatch = (bool) $this->getSameVarName($node->catches, $variable);
|
||||
$isFoundInFinally = (bool) $this->getSameVarName([$node->finally], $variable);
|
||||
if ($isFoundInCatch || $isFoundInFinally) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithSwitchCase(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\Switch_) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCases = (bool) $this->getSameVarName($node->cases, $variable);
|
||||
if ($isFoundInCases) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
return $nextVariable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT);
|
||||
}
|
||||
}
|
165
rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php
Normal file
165
rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\UsageFinder;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\InlineHTML;
|
||||
use PhpParser\Node\Stmt\Switch_;
|
||||
use PhpParser\Node\Stmt\TryCatch;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\DeadCode\SideEffect\SideEffectNodeDetector;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class UsageInNextStmtFinder
|
||||
{
|
||||
/**
|
||||
* @var \Rector\DeadCode\SideEffect\SideEffectNodeDetector
|
||||
*/
|
||||
private $sideEffectNodeDetector;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
public function __construct(\Rector\DeadCode\SideEffect\SideEffectNodeDetector $sideEffectNodeDetector, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver)
|
||||
{
|
||||
$this->sideEffectNodeDetector = $sideEffectNodeDetector;
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
}
|
||||
public function getUsageInNextStmts(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
/** @var Node|null $next */
|
||||
$next = $expression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
if (!$next instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
if ($next instanceof \PhpParser\Node\Stmt\InlineHTML) {
|
||||
return null;
|
||||
}
|
||||
if ($this->hasCall($next)) {
|
||||
return null;
|
||||
}
|
||||
$countFound = $this->getCountFound($next, $variable);
|
||||
if ($countFound === 0) {
|
||||
return null;
|
||||
}
|
||||
if ($countFound >= 2) {
|
||||
return null;
|
||||
}
|
||||
$nextVariable = $this->getSameVarName([$next], $variable);
|
||||
if ($nextVariable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $nextVariable;
|
||||
}
|
||||
return $this->getSameVarNameInNexts($next, $variable);
|
||||
}
|
||||
private function hasCall(\PhpParser\Node $node) : bool
|
||||
{
|
||||
return (bool) $this->betterNodeFinder->findFirst($node, function (\PhpParser\Node $n) : bool {
|
||||
return $this->sideEffectNodeDetector->detectCallExpr($n);
|
||||
});
|
||||
}
|
||||
private function getCountFound(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : int
|
||||
{
|
||||
$countFound = 0;
|
||||
while ($node) {
|
||||
$isFound = (bool) $this->getSameVarName([$node], $variable);
|
||||
if ($isFound) {
|
||||
++$countFound;
|
||||
}
|
||||
$countFound = $this->countWithElseIf($node, $variable, $countFound);
|
||||
$countFound = $this->countWithTryCatch($node, $variable, $countFound);
|
||||
$countFound = $this->countWithSwitchCase($node, $variable, $countFound);
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function getSameVarNameInNexts(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
while ($node) {
|
||||
$found = $this->getSameVarName([$node], $variable);
|
||||
if ($found instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $found;
|
||||
}
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function countWithElseIf(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\If_) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundElseIf = (bool) $this->getSameVarName($node->elseifs, $variable);
|
||||
$isFoundElse = (bool) $this->getSameVarName([$node->else], $variable);
|
||||
if ($isFoundElseIf || $isFoundElse) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithTryCatch(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\TryCatch) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCatch = (bool) $this->getSameVarName($node->catches, $variable);
|
||||
$isFoundInFinally = (bool) $this->getSameVarName([$node->finally], $variable);
|
||||
if ($isFoundInCatch || $isFoundInFinally) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithSwitchCase(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\Switch_) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCases = (bool) $this->getSameVarName($node->cases, $variable);
|
||||
if ($isFoundInCases) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
/**
|
||||
* @param array<int, Node|null> $multiNodes
|
||||
*/
|
||||
private function getSameVarName(array $multiNodes, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
foreach ($multiNodes as $multiNode) {
|
||||
if ($multiNode === null) {
|
||||
continue;
|
||||
}
|
||||
/** @var Variable|null $found */
|
||||
$found = $this->betterNodeFinder->findFirst($multiNode, function (\PhpParser\Node $currentNode) use($variable) : bool {
|
||||
$currentNode = $this->unwrapArrayDimFetch($currentNode);
|
||||
if (!$currentNode instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return \false;
|
||||
}
|
||||
return $this->nodeNameResolver->isName($currentNode, (string) $this->nodeNameResolver->getName($variable));
|
||||
});
|
||||
if ($found !== null) {
|
||||
return $found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function unwrapArrayDimFetch(\PhpParser\Node $node) : \PhpParser\Node
|
||||
{
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
while ($parent instanceof \PhpParser\Node\Expr\ArrayDimFetch) {
|
||||
$node = $parent->var;
|
||||
$parent = $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
}
|
|
@ -47,30 +47,32 @@ final class ReturnArrayClassMethodToYieldRector extends \Rector\Core\Rector\Abst
|
|||
{
|
||||
$this->nodeTransformer = $nodeTransformer;
|
||||
$this->commentsMerger = $commentsMerger;
|
||||
// default values
|
||||
$this->methodsToYields = [new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('PHPUnit\\Framework\\TestCase', 'provideData'), new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('PHPUnit\\Framework\\TestCase', 'provideData*'), new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('PHPUnit\\Framework\\TestCase', 'dataProvider'), new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('PHPUnit\\Framework\\TestCase', 'dataProvider*')];
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Turns array return to yield return in specific type and method', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest implements TestCase
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
public static function provideData()
|
||||
{
|
||||
return ['event' => 'callback'];
|
||||
return [['some text']];
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest implements TestCase
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
public static function provideData()
|
||||
{
|
||||
yield 'event' => 'callback';
|
||||
yield ['some text'];
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [self::METHODS_TO_YIELDS => [new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('EventSubscriberInterface', 'getSubscribedEvents')]])]);
|
||||
, [self::METHODS_TO_YIELDS => [new \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield('PHPUnit\\Framework\\TestCase', '*provide*')]])]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Yield_;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
||||
use Rector\Core\PhpParser\NodeTransformer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @changelog https://medium.com/tech-tajawal/use-memory-gently-with-yield-in-php-7e62e2480b8d
|
||||
* @see https://3v4l.org/5PJid
|
||||
*
|
||||
* @see \Rector\Tests\CodingStyle\Rector\ClassMethod\YieldClassMethodToArrayClassMethodRector\YieldClassMethodToArrayClassMethodRectorTest
|
||||
*/
|
||||
final class YieldClassMethodToArrayClassMethodRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const METHODS_BY_TYPE = 'methods_by_type';
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\NodeTransformer
|
||||
*/
|
||||
private $nodeTransformer;
|
||||
/**
|
||||
* @var mixed[]
|
||||
*/
|
||||
private $methodsByType = [];
|
||||
/**
|
||||
* @param array<class-string, string[]> $methodsByType
|
||||
*/
|
||||
public function __construct(\Rector\Core\PhpParser\NodeTransformer $nodeTransformer, array $methodsByType = [])
|
||||
{
|
||||
$this->nodeTransformer = $nodeTransformer;
|
||||
$this->methodsByType = $methodsByType;
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Turns yield return to array return in specific type and method', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
yield 'event' => 'callback';
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
class SomeEventSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return ['event' => 'callback'];
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [self::METHODS_BY_TYPE => ['EventSubscriberInterface' => ['getSubscribedEvents']]])]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [\PhpParser\Node\Stmt\ClassMethod::class];
|
||||
}
|
||||
/**
|
||||
* @param ClassMethod $node
|
||||
*/
|
||||
public function refactor(\PhpParser\Node $node) : \PhpParser\Node\Stmt\ClassMethod
|
||||
{
|
||||
foreach ($this->methodsByType as $type => $methods) {
|
||||
if (!$this->isObjectType($node, new \PHPStan\Type\ObjectType($type))) {
|
||||
continue;
|
||||
}
|
||||
foreach ($methods as $method) {
|
||||
if (!$this->isName($node, $method)) {
|
||||
continue;
|
||||
}
|
||||
$yieldNodes = $this->collectYieldNodesFromClassMethod($node);
|
||||
if ($yieldNodes === []) {
|
||||
continue;
|
||||
}
|
||||
$arrayNode = $this->nodeTransformer->transformYieldsToArray($yieldNodes);
|
||||
$this->removeNodes($yieldNodes);
|
||||
$node->returnType = new \PhpParser\Node\Identifier('array');
|
||||
$returnExpression = new \PhpParser\Node\Stmt\Return_($arrayNode);
|
||||
$node->stmts = \array_merge((array) $node->stmts, [$returnExpression]);
|
||||
}
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
$this->methodsByType = $configuration[self::METHODS_BY_TYPE] ?? [];
|
||||
}
|
||||
/**
|
||||
* @return Yield_[]
|
||||
*/
|
||||
private function collectYieldNodesFromClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : array
|
||||
{
|
||||
$yieldNodes = [];
|
||||
if ($classMethod->stmts === null) {
|
||||
return [];
|
||||
}
|
||||
foreach ($classMethod->stmts as $statement) {
|
||||
if (!$statement instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
continue;
|
||||
}
|
||||
if ($statement->expr instanceof \PhpParser\Node\Expr\Yield_) {
|
||||
$yieldNodes[] = $statement->expr;
|
||||
}
|
||||
}
|
||||
return $yieldNodes;
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ final class PreferThisOrSelfMethodCallRector extends \Rector\Core\Rector\Abstrac
|
|||
*/
|
||||
private const SELF = 'self';
|
||||
/**
|
||||
* @var array<class-string, PreferenceSelfThis>
|
||||
* @var array<PreferenceSelfThis>
|
||||
*/
|
||||
private $typeToPreference = [];
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
|
@ -78,7 +78,7 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
/**
|
||||
* @param array<string, array<class-string, PreferenceSelfThis>> $configuration
|
||||
* @param array<string, PreferenceSelfThis[]> $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@ use PhpParser\Node\Expr\Variable;
|
|||
use Rector\Core\NodeAnalyzer\CompactFuncCallAnalyzer;
|
||||
use Rector\Core\PhpParser\Comparing\NodeComparator;
|
||||
use Rector\Core\PhpParser\Printer\BetterStandardPrinter;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
final class ExprUsedInNodeAnalyzer
|
||||
{
|
||||
/**
|
||||
|
@ -26,20 +25,15 @@ final class ExprUsedInNodeAnalyzer
|
|||
* @var \Rector\Core\NodeAnalyzer\CompactFuncCallAnalyzer
|
||||
*/
|
||||
private $compactFuncCallAnalyzer;
|
||||
/**
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\Printer\BetterStandardPrinter
|
||||
*/
|
||||
private $betterStandardPrinter;
|
||||
public function __construct(\Rector\Core\PhpParser\Comparing\NodeComparator $nodeComparator, \Rector\DeadCode\NodeAnalyzer\UsedVariableNameAnalyzer $usedVariableNameAnalyzer, \Rector\Core\NodeAnalyzer\CompactFuncCallAnalyzer $compactFuncCallAnalyzer, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\Printer\BetterStandardPrinter $betterStandardPrinter)
|
||||
public function __construct(\Rector\Core\PhpParser\Comparing\NodeComparator $nodeComparator, \Rector\DeadCode\NodeAnalyzer\UsedVariableNameAnalyzer $usedVariableNameAnalyzer, \Rector\Core\NodeAnalyzer\CompactFuncCallAnalyzer $compactFuncCallAnalyzer, \Rector\Core\PhpParser\Printer\BetterStandardPrinter $betterStandardPrinter)
|
||||
{
|
||||
$this->nodeComparator = $nodeComparator;
|
||||
$this->usedVariableNameAnalyzer = $usedVariableNameAnalyzer;
|
||||
$this->compactFuncCallAnalyzer = $compactFuncCallAnalyzer;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->betterStandardPrinter = $betterStandardPrinter;
|
||||
}
|
||||
public function isUsed(\PhpParser\Node $node, \PhpParser\Node\Expr $expr) : bool
|
||||
|
|
|
@ -90,7 +90,7 @@ CODE_SAMPLE
|
|||
continue;
|
||||
}
|
||||
if ($this->propertyManipulator->isPropertyUsedInReadContext($param)) {
|
||||
return null;
|
||||
continue;
|
||||
}
|
||||
// only private local scope; removing public property might be dangerous
|
||||
if ($param->flags !== \PhpParser\Node\Stmt\Class_::MODIFIER_PRIVATE) {
|
||||
|
|
|
@ -10,7 +10,6 @@ use PhpParser\Node\Expr\AssignOp\Div as AssignDiv;
|
|||
use PhpParser\Node\Expr\AssignOp\Minus as AssignMinus;
|
||||
use PhpParser\Node\Expr\AssignOp\Mul as AssignMul;
|
||||
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus;
|
||||
use PhpParser\Node\Expr\BinaryOp;
|
||||
use PhpParser\Node\Expr\BinaryOp\Div;
|
||||
use PhpParser\Node\Expr\BinaryOp\Minus;
|
||||
use PhpParser\Node\Expr\BinaryOp\Mul;
|
||||
|
@ -62,24 +61,13 @@ CODE_SAMPLE
|
|||
*/
|
||||
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
|
||||
{
|
||||
$changedNode = null;
|
||||
$previousNode = $node;
|
||||
// $changedNode = null;
|
||||
// $previousNode = $node;
|
||||
if ($node instanceof \PhpParser\Node\Expr\AssignOp) {
|
||||
$changedNode = $this->processAssignOp($node);
|
||||
return $this->processAssignOp($node);
|
||||
}
|
||||
// -, +
|
||||
if ($node instanceof \PhpParser\Node\Expr\BinaryOp) {
|
||||
$changedNode = $this->processBinaryOp($node);
|
||||
}
|
||||
// recurse nested combinations
|
||||
while ($changedNode !== null && !$this->nodeComparator->areNodesEqual($previousNode, $changedNode)) {
|
||||
$previousNode = $changedNode;
|
||||
// nothing more to change, return last node
|
||||
if (!$changedNode instanceof \PhpParser\Node) {
|
||||
return $previousNode;
|
||||
}
|
||||
}
|
||||
return $changedNode;
|
||||
return $this->processBinaryOp($node);
|
||||
}
|
||||
private function processAssignOp(\PhpParser\Node $node) : ?\PhpParser\Node\Expr
|
||||
{
|
||||
|
|
|
@ -13,7 +13,6 @@ use PhpParser\Node\Expr\List_;
|
|||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\Foreach_;
|
||||
use Rector\CodeQuality\NodeAnalyzer\ForeachAnalyzer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Naming\ExpectedNameResolver\InflectorSingularResolver;
|
||||
use Rector\Naming\Naming\VariableNaming;
|
||||
|
@ -29,18 +28,13 @@ final class DowngradeKeysInListRector extends \Rector\Core\Rector\AbstractRector
|
|||
* @var \Rector\Naming\ExpectedNameResolver\InflectorSingularResolver
|
||||
*/
|
||||
private $inflectorSingularResolver;
|
||||
/**
|
||||
* @var \Rector\CodeQuality\NodeAnalyzer\ForeachAnalyzer
|
||||
*/
|
||||
private $foreachAnalyzer;
|
||||
/**
|
||||
* @var \Rector\Naming\Naming\VariableNaming
|
||||
*/
|
||||
private $variableNaming;
|
||||
public function __construct(\Rector\Naming\ExpectedNameResolver\InflectorSingularResolver $inflectorSingularResolver, \Rector\CodeQuality\NodeAnalyzer\ForeachAnalyzer $foreachAnalyzer, \Rector\Naming\Naming\VariableNaming $variableNaming)
|
||||
public function __construct(\Rector\Naming\ExpectedNameResolver\InflectorSingularResolver $inflectorSingularResolver, \Rector\Naming\Naming\VariableNaming $variableNaming)
|
||||
{
|
||||
$this->inflectorSingularResolver = $inflectorSingularResolver;
|
||||
$this->foreachAnalyzer = $foreachAnalyzer;
|
||||
$this->variableNaming = $variableNaming;
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -9,10 +9,8 @@ use PHPStan\Type\ObjectType;
|
|||
use PHPStan\Type\StaticType;
|
||||
use PHPStan\Type\Type;
|
||||
use PHPStan\Type\TypeWithClassName;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\Naming\RectorNamingInflector;
|
||||
use Rector\Naming\ValueObject\ExpectedName;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
use Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper;
|
||||
use Rector\StaticTypeMapper\ValueObject\Type\SelfObjectType;
|
||||
|
@ -50,14 +48,6 @@ final class PropertyNaming
|
|||
* @var \Rector\Naming\RectorNamingInflector
|
||||
*/
|
||||
private $rectorNamingInflector;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
/**
|
||||
* @var \Rector\NodeTypeResolver\NodeTypeResolver
|
||||
*/
|
||||
|
@ -66,12 +56,10 @@ final class PropertyNaming
|
|||
* @var \PHPStan\Reflection\ReflectionProvider
|
||||
*/
|
||||
private $reflectionProvider;
|
||||
public function __construct(\Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper $typeUnwrapper, \Rector\Naming\RectorNamingInflector $rectorNamingInflector, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider)
|
||||
public function __construct(\Rector\PHPStanStaticTypeMapper\Utils\TypeUnwrapper $typeUnwrapper, \Rector\Naming\RectorNamingInflector $rectorNamingInflector, \Rector\NodeTypeResolver\NodeTypeResolver $nodeTypeResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider)
|
||||
{
|
||||
$this->typeUnwrapper = $typeUnwrapper;
|
||||
$this->rectorNamingInflector = $rectorNamingInflector;
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->nodeTypeResolver = $nodeTypeResolver;
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ use PhpParser\Node\UnionType;
|
|||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\Core\PhpParser\AstResolver;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
final class CallerParamMatcher
|
||||
{
|
||||
|
@ -28,15 +27,10 @@ final class CallerParamMatcher
|
|||
* @var \Rector\Core\PhpParser\AstResolver
|
||||
*/
|
||||
private $astResolver;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
public function __construct(\Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\AstResolver $astResolver, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
|
||||
public function __construct(\Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\AstResolver $astResolver)
|
||||
{
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->astResolver = $astResolver;
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\FuncCall $call
|
||||
|
|
|
@ -16,23 +16,20 @@ use PHPStan\Type\StringType;
|
|||
use PHPStan\Type\Type;
|
||||
use PHPStan\Type\TypeTraverser;
|
||||
use PHPStan\Type\UnionType;
|
||||
use RectorPrefix20210802\Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||
final class GenericClassStringTypeNormalizer
|
||||
{
|
||||
/**
|
||||
* @var \PHPStan\Reflection\ReflectionProvider
|
||||
*/
|
||||
private $reflectionProvider;
|
||||
/**
|
||||
* @var \Symplify\PackageBuilder\Parameter\ParameterProvider
|
||||
*/
|
||||
private $parameterProvider;
|
||||
public function __construct(\PHPStan\Reflection\ReflectionProvider $reflectionProvider, \RectorPrefix20210802\Symplify\PackageBuilder\Parameter\ParameterProvider $parameterProvider)
|
||||
public function __construct(\PHPStan\Reflection\ReflectionProvider $reflectionProvider)
|
||||
{
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
$this->parameterProvider = $parameterProvider;
|
||||
}
|
||||
public function normalize(\PHPStan\Type\Type $type) : \PHPStan\Type\Type
|
||||
/**
|
||||
* @return \PHPStan\Type\ArrayType|\PHPStan\Type\UnionType|\PHPStan\Type\Type
|
||||
*/
|
||||
public function normalize(\PHPStan\Type\Type $type)
|
||||
{
|
||||
$type = \PHPStan\Type\TypeTraverser::map($type, function (\PHPStan\Type\Type $type, $callback) : Type {
|
||||
if (!$type instanceof \PHPStan\Type\Constant\ConstantStringType) {
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '5145487e37a5ed2b83296caf534a1fb9f10e6f69';
|
||||
public const PACKAGE_VERSION = 'b3480900f3da86846dfabdfcd7e12f07b16a3f78';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-08-02 17:50:38';
|
||||
public const RELEASE_DATE = '2021-08-02 17:39:36';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210802\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
|
@ -10,16 +10,12 @@ use PhpParser\Node\Param;
|
|||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use PhpParser\Parser;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use Rector\Core\NodeAnalyzer\ClassAnalyzer;
|
||||
use Rector\Core\PhpParser\AstResolver;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\Core\Reflection\ReflectionResolver;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator;
|
||||
use RectorPrefix20210802\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
final class PropertyFetchFinder
|
||||
{
|
||||
/**
|
||||
|
@ -34,22 +30,6 @@ final class PropertyFetchFinder
|
|||
* @var \PHPStan\Reflection\ReflectionProvider
|
||||
*/
|
||||
private $reflectionProvider;
|
||||
/**
|
||||
* @var \Rector\Core\Reflection\ReflectionResolver
|
||||
*/
|
||||
private $reflectionResolver;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\SmartFileSystem
|
||||
*/
|
||||
private $smartFileSystem;
|
||||
/**
|
||||
* @var \PhpParser\Parser
|
||||
*/
|
||||
private $parser;
|
||||
/**
|
||||
* @var \Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator
|
||||
*/
|
||||
private $nodeScopeAndMetadataDecorator;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\AstResolver
|
||||
*/
|
||||
|
@ -58,15 +38,11 @@ final class PropertyFetchFinder
|
|||
* @var \Rector\Core\NodeAnalyzer\ClassAnalyzer
|
||||
*/
|
||||
private $classAnalyzer;
|
||||
public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider, \Rector\Core\Reflection\ReflectionResolver $reflectionResolver, \RectorPrefix20210802\Symplify\SmartFileSystem\SmartFileSystem $smartFileSystem, \PhpParser\Parser $parser, \Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator, \Rector\Core\PhpParser\AstResolver $astResolver, \Rector\Core\NodeAnalyzer\ClassAnalyzer $classAnalyzer)
|
||||
public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \PHPStan\Reflection\ReflectionProvider $reflectionProvider, \Rector\Core\PhpParser\AstResolver $astResolver, \Rector\Core\NodeAnalyzer\ClassAnalyzer $classAnalyzer)
|
||||
{
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
$this->reflectionResolver = $reflectionResolver;
|
||||
$this->smartFileSystem = $smartFileSystem;
|
||||
$this->parser = $parser;
|
||||
$this->nodeScopeAndMetadataDecorator = $nodeScopeAndMetadataDecorator;
|
||||
$this->astResolver = $astResolver;
|
||||
$this->classAnalyzer = $classAnalyzer;
|
||||
}
|
||||
|
|
|
@ -49,26 +49,6 @@ final class NodeTransformer
|
|||
}
|
||||
return new \PhpParser\Node\Expr\Array_($arrayMessageParts);
|
||||
}
|
||||
/**
|
||||
* @param Yield_[]|Expression[] $yieldNodes
|
||||
*/
|
||||
public function transformYieldsToArray(array $yieldNodes) : \PhpParser\Node\Expr\Array_
|
||||
{
|
||||
$arrayItems = [];
|
||||
foreach ($yieldNodes as $yieldNode) {
|
||||
if ($yieldNode instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
$yieldNode = $yieldNode->expr;
|
||||
}
|
||||
if (!$yieldNode instanceof \PhpParser\Node\Expr\Yield_) {
|
||||
continue;
|
||||
}
|
||||
if ($yieldNode->value === null) {
|
||||
continue;
|
||||
}
|
||||
$arrayItems[] = new \PhpParser\Node\Expr\ArrayItem($yieldNode->value, $yieldNode->key);
|
||||
}
|
||||
return new \PhpParser\Node\Expr\Array_($arrayItems);
|
||||
}
|
||||
/**
|
||||
* @return Expression[]
|
||||
*/
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143::getLoader();
|
||||
return ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2::getLoader();
|
||||
|
|
4
vendor/composer/autoload_classmap.php
vendored
4
vendor/composer/autoload_classmap.php
vendored
|
@ -1598,7 +1598,6 @@ return array(
|
|||
'Rector\\ChangesReporting\\ValueObjectFactory\\FileDiffFactory' => $baseDir . '/packages/ChangesReporting/ValueObjectFactory/FileDiffFactory.php',
|
||||
'Rector\\ChangesReporting\\ValueObject\\RectorWithLineChange' => $baseDir . '/packages/ChangesReporting/ValueObject/RectorWithLineChange.php',
|
||||
'Rector\\CodeQualityStrict\\NodeFactory\\ClassConstFetchFactory' => $baseDir . '/rules/CodeQualityStrict/NodeFactory/ClassConstFetchFactory.php',
|
||||
'Rector\\CodeQualityStrict\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => $baseDir . '/rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQualityStrict\\TypeAnalyzer\\SubTypeAnalyzer' => $baseDir . '/rules/CodeQualityStrict/TypeAnalyzer/SubTypeAnalyzer.php',
|
||||
'Rector\\CodeQuality\\CompactConverter' => $baseDir . '/rules/CodeQuality/CompactConverter.php',
|
||||
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayCompacter' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ArrayCompacter.php',
|
||||
|
@ -1679,8 +1678,10 @@ return array(
|
|||
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyTautologyTernaryRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/SimplifyTautologyTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\SwitchNegatedTernaryRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/SwitchNegatedTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\UnnecessaryTernaryExpressionRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/UnnecessaryTernaryExpressionRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => $baseDir . '/rules/CodeQuality/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\ArrayDimFetchTypeResolver' => $baseDir . '/rules/CodeQuality/TypeResolver/ArrayDimFetchTypeResolver.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\AssignVariableTypeResolver' => $baseDir . '/rules/CodeQuality/TypeResolver/AssignVariableTypeResolver.php',
|
||||
'Rector\\CodeQuality\\UsageFinder\\UsageInNextStmtFinder' => $baseDir . '/rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsAdder' => $baseDir . '/rules/CodingStyle/Application/UseImportsAdder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsRemover' => $baseDir . '/rules/CodingStyle/Application/UseImportsRemover.php',
|
||||
'Rector\\CodingStyle\\ClassNameImport\\AliasUsesResolver' => $baseDir . '/rules/CodingStyle/ClassNameImport/AliasUsesResolver.php',
|
||||
|
@ -1721,7 +1722,6 @@ return array(
|
|||
'Rector\\CodingStyle\\Rector\\ClassMethod\\RemoveDoubleUnderscoreInMethodNameRector' => $baseDir . '/rules/CodingStyle/Rector/ClassMethod/RemoveDoubleUnderscoreInMethodNameRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\ReturnArrayClassMethodToYieldRector' => $baseDir . '/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\UnSpreadOperatorRector' => $baseDir . '/rules/CodingStyle/Rector/ClassMethod/UnSpreadOperatorRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\YieldClassMethodToArrayClassMethodRector' => $baseDir . '/rules/CodingStyle/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Class_\\AddArrayDefaultToArrayPropertyRector' => $baseDir . '/rules/CodingStyle/Rector/Class_/AddArrayDefaultToArrayPropertyRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Encapsed\\EncapsedStringsToSprintfRector' => $baseDir . '/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Encapsed\\WrapEncapsedVariableInCurlyBracesRector' => $baseDir . '/rules/CodingStyle/Rector/Encapsed/WrapEncapsedVariableInCurlyBracesRector.php',
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143
|
||||
class ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireefdcc4d5a886384f0eaef8357453d143($fileIdentifier, $file);
|
||||
composerRequire515a7719282ef2aa9111616aa962f8f2($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequireefdcc4d5a886384f0eaef8357453d143($fileIdentifier, $file)
|
||||
function composerRequire515a7719282ef2aa9111616aa962f8f2($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
12
vendor/composer/autoload_static.php
vendored
12
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
|
||||
class ComposerStaticInit515a7719282ef2aa9111616aa962f8f2
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -1958,7 +1958,6 @@ class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
|
|||
'Rector\\ChangesReporting\\ValueObjectFactory\\FileDiffFactory' => __DIR__ . '/../..' . '/packages/ChangesReporting/ValueObjectFactory/FileDiffFactory.php',
|
||||
'Rector\\ChangesReporting\\ValueObject\\RectorWithLineChange' => __DIR__ . '/../..' . '/packages/ChangesReporting/ValueObject/RectorWithLineChange.php',
|
||||
'Rector\\CodeQualityStrict\\NodeFactory\\ClassConstFetchFactory' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/NodeFactory/ClassConstFetchFactory.php',
|
||||
'Rector\\CodeQualityStrict\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQualityStrict\\TypeAnalyzer\\SubTypeAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/TypeAnalyzer/SubTypeAnalyzer.php',
|
||||
'Rector\\CodeQuality\\CompactConverter' => __DIR__ . '/../..' . '/rules/CodeQuality/CompactConverter.php',
|
||||
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayCompacter' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ArrayCompacter.php',
|
||||
|
@ -2039,8 +2038,10 @@ class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
|
|||
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyTautologyTernaryRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/SimplifyTautologyTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\SwitchNegatedTernaryRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/SwitchNegatedTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\UnnecessaryTernaryExpressionRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/UnnecessaryTernaryExpressionRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\ArrayDimFetchTypeResolver' => __DIR__ . '/../..' . '/rules/CodeQuality/TypeResolver/ArrayDimFetchTypeResolver.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\AssignVariableTypeResolver' => __DIR__ . '/../..' . '/rules/CodeQuality/TypeResolver/AssignVariableTypeResolver.php',
|
||||
'Rector\\CodeQuality\\UsageFinder\\UsageInNextStmtFinder' => __DIR__ . '/../..' . '/rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsAdder' => __DIR__ . '/../..' . '/rules/CodingStyle/Application/UseImportsAdder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsRemover' => __DIR__ . '/../..' . '/rules/CodingStyle/Application/UseImportsRemover.php',
|
||||
'Rector\\CodingStyle\\ClassNameImport\\AliasUsesResolver' => __DIR__ . '/../..' . '/rules/CodingStyle/ClassNameImport/AliasUsesResolver.php',
|
||||
|
@ -2081,7 +2082,6 @@ class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
|
|||
'Rector\\CodingStyle\\Rector\\ClassMethod\\RemoveDoubleUnderscoreInMethodNameRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/ClassMethod/RemoveDoubleUnderscoreInMethodNameRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\ReturnArrayClassMethodToYieldRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\UnSpreadOperatorRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/ClassMethod/UnSpreadOperatorRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\ClassMethod\\YieldClassMethodToArrayClassMethodRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Class_\\AddArrayDefaultToArrayPropertyRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Class_/AddArrayDefaultToArrayPropertyRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Encapsed\\EncapsedStringsToSprintfRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Encapsed/EncapsedStringsToSprintfRector.php',
|
||||
'Rector\\CodingStyle\\Rector\\Encapsed\\WrapEncapsedVariableInCurlyBracesRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Encapsed/WrapEncapsedVariableInCurlyBracesRector.php',
|
||||
|
@ -3847,9 +3847,9 @@ class ComposerStaticInitefdcc4d5a886384f0eaef8357453d143
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitefdcc4d5a886384f0eaef8357453d143::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit515a7719282ef2aa9111616aa962f8f2::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
210
vendor/composer/installed.json
vendored
210
vendor/composer/installed.json
vendored
|
@ -3804,17 +3804,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/astral",
|
||||
"version": "9.4.23",
|
||||
"version_normalized": "9.4.23.0",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/astral.git",
|
||||
"reference": "0f396195031a147de2b3364868737f2d08ecb2dd"
|
||||
"reference": "6b0a7c63b534ecc663ede26158ab5b39ed9f52ec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/0f396195031a147de2b3364868737f2d08ecb2dd",
|
||||
"reference": "0f396195031a147de2b3364868737f2d08ecb2dd",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/6b0a7c63b534ecc663ede26158ab5b39ed9f52ec",
|
||||
"reference": "6b0a7c63b534ecc663ede26158ab5b39ed9f52ec",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3823,14 +3823,14 @@
|
|||
"php": ">=8.0",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/autowire-array-parameter": "^9.4.23",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/autowire-array-parameter": "^9.4.24",
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"symplify\/easy-testing": "^9.4.23"
|
||||
"symplify\/easy-testing": "^9.4.24"
|
||||
},
|
||||
"time": "2021-07-24T11:01:05+00:00",
|
||||
"time": "2021-08-02T17:04:24+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -3849,7 +3849,7 @@
|
|||
],
|
||||
"description": "Toolking for smart daily work with AST",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/astral\/tree\/9.4.23"
|
||||
"source": "https:\/\/github.com\/symplify\/astral\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3865,30 +3865,29 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/autowire-array-parameter",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/autowire-array-parameter.git",
|
||||
"reference": "1209245a341fb95782d2c594f375ccd5faae38ba"
|
||||
"reference": "5e4a49a36acd2a6f45faaedcdc06121555193c90"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/1209245a341fb95782d2c594f375ccd5faae38ba",
|
||||
"reference": "1209245a341fb95782d2c594f375ccd5faae38ba",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/5e4a49a36acd2a6f45faaedcdc06121555193c90",
|
||||
"reference": "5e4a49a36acd2a6f45faaedcdc06121555193c90",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.0",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/package-builder": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-24T11:29:38+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:04:30+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -3907,7 +3906,7 @@
|
|||
],
|
||||
"description": "Autowire array parameters for your Symfony applications",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3923,17 +3922,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/composer-json-manipulator",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/composer-json-manipulator.git",
|
||||
"reference": "a1095453a0f170e3ba086640e595d6d52493045f"
|
||||
"reference": "d635d1da456b2fe942f97e24f0e6303f9cd2f6bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/composer-json-manipulator\/zipball\/a1095453a0f170e3ba086640e595d6d52493045f",
|
||||
"reference": "a1095453a0f170e3ba086640e595d6d52493045f",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/composer-json-manipulator\/zipball\/d635d1da456b2fe942f97e24f0e6303f9cd2f6bb",
|
||||
"reference": "d635d1da456b2fe942f97e24f0e6303f9cd2f6bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -3943,14 +3942,13 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/filesystem": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/smart-file-system": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-24T11:29:47+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:04:43+00:00",
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -3969,7 +3967,7 @@
|
|||
],
|
||||
"description": "Package to load, merge and save composer.json file(s)",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/composer-json-manipulator\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/composer-json-manipulator\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -3985,17 +3983,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/console-color-diff",
|
||||
"version": "9.4.23",
|
||||
"version_normalized": "9.4.23.0",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/console-color-diff.git",
|
||||
"reference": "d758ba2f3e63e8d3eb7ecda632523ab26dc34c90"
|
||||
"reference": "569802566c4115903122d2e459675ec7b47ad3aa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/console-color-diff\/zipball\/d758ba2f3e63e8d3eb7ecda632523ab26dc34c90",
|
||||
"reference": "d758ba2f3e63e8d3eb7ecda632523ab26dc34c90",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/console-color-diff\/zipball\/569802566c4115903122d2e459675ec7b47ad3aa",
|
||||
"reference": "569802566c4115903122d2e459675ec7b47ad3aa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4005,12 +4003,12 @@
|
|||
"symfony\/console": "^5.3.x-dev",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-24T11:01:25+00:00",
|
||||
"time": "2021-08-02T17:04:40+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4029,7 +4027,7 @@
|
|||
],
|
||||
"description": "Package to print diffs in console with colors",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/console-color-diff\/tree\/9.4.23"
|
||||
"source": "https:\/\/github.com\/symplify\/console-color-diff\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4045,32 +4043,31 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/console-package-builder",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/console-package-builder.git",
|
||||
"reference": "ee1220b01d6d02d8933fc2bb40584573a43b2463"
|
||||
"reference": "a0be08f1cf0f4d4b3183fbf771a4db42f3052775"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/console-package-builder\/zipball\/ee1220b01d6d02d8933fc2bb40584573a43b2463",
|
||||
"reference": "ee1220b01d6d02d8933fc2bb40584573a43b2463",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/console-package-builder\/zipball\/a0be08f1cf0f4d4b3183fbf771a4db42f3052775",
|
||||
"reference": "a0be08f1cf0f4d4b3183fbf771a4db42f3052775",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"symfony\/console": "^5.3.x-dev",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/symplify-kernel": "^9.5"
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"time": "2021-07-24T11:29:42+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:04:41+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4089,23 +4086,23 @@
|
|||
],
|
||||
"description": "Package to speed up building command line applications",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/console-package-builder\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/console-package-builder\/tree\/9.4.24"
|
||||
},
|
||||
"install-path": "..\/symplify\/console-package-builder"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/easy-testing",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/easy-testing.git",
|
||||
"reference": "049d83e"
|
||||
"reference": "a4303c6d598684164d74cdd4d38a7613b692ce1d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-testing\/zipball\/049d83e",
|
||||
"reference": "049d83e",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-testing\/zipball\/a4303c6d598684164d74cdd4d38a7613b692ce1d",
|
||||
"reference": "a4303c6d598684164d74cdd4d38a7613b692ce1d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4115,16 +4112,15 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/finder": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/console-package-builder": "^9.5",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/smart-file-system": "^9.5",
|
||||
"symplify\/symplify-kernel": "^9.5"
|
||||
"symplify\/console-package-builder": "^9.4.24",
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24",
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-30T14:34:08+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:05:00+00:00",
|
||||
"bin": [
|
||||
"bin\/easy-testing"
|
||||
],
|
||||
|
@ -4146,7 +4142,7 @@
|
|||
],
|
||||
"description": "Testing made easy",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/easy-testing\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/easy-testing\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4162,17 +4158,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/package-builder",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/package-builder.git",
|
||||
"reference": "a36cafd450ac57f91643497c5df194f100d04399"
|
||||
"reference": "12cb6effeac6868e556c179d908114c980be3d11"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/a36cafd450ac57f91643497c5df194f100d04399",
|
||||
"reference": "a36cafd450ac57f91643497c5df194f100d04399",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/12cb6effeac6868e556c179d908114c980be3d11",
|
||||
"reference": "12cb6effeac6868e556c179d908114c980be3d11",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4184,14 +4180,13 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/finder": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/easy-testing": "^9.5",
|
||||
"symplify\/symplify-kernel": "^9.5"
|
||||
"symplify\/easy-testing": "^9.4.24",
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-25T21:12:51+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:05:23+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4210,7 +4205,7 @@
|
|||
],
|
||||
"description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/package-builder\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/package-builder\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4226,8 +4221,8 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/rule-doc-generator-contracts",
|
||||
"version": "9.4.23",
|
||||
"version_normalized": "9.4.23.0",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts.git",
|
||||
|
@ -4279,17 +4274,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/simple-php-doc-parser",
|
||||
"version": "9.4.23",
|
||||
"version_normalized": "9.4.23.0",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/simple-php-doc-parser.git",
|
||||
"reference": "1121c3122d8f26e44e772540d8acaa286b5abe0e"
|
||||
"reference": "bbe7a7821b8431e2b456c0acd060f2c3232967e8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/simple-php-doc-parser\/zipball\/1121c3122d8f26e44e772540d8acaa286b5abe0e",
|
||||
"reference": "1121c3122d8f26e44e772540d8acaa286b5abe0e",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/simple-php-doc-parser\/zipball\/bbe7a7821b8431e2b456c0acd060f2c3232967e8",
|
||||
"reference": "bbe7a7821b8431e2b456c0acd060f2c3232967e8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4298,13 +4293,13 @@
|
|||
"symfony\/config": "^5.3",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"symplify\/easy-testing": "^9.4.23"
|
||||
"symplify\/easy-testing": "^9.4.24"
|
||||
},
|
||||
"time": "2021-07-24T11:02:12+00:00",
|
||||
"time": "2021-08-02T17:06:12+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4323,7 +4318,7 @@
|
|||
],
|
||||
"description": "Service integration of phpstan\/phpdoc-parser, with few extra goodies for practical simple use",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/simple-php-doc-parser\/tree\/9.4.23"
|
||||
"source": "https:\/\/github.com\/symplify\/simple-php-doc-parser\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4339,17 +4334,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/skipper",
|
||||
"version": "9.4.23",
|
||||
"version_normalized": "9.4.23.0",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/skipper.git",
|
||||
"reference": "eb22a1dbb48f1bc4c9d6efe51c57d326c504deef"
|
||||
"reference": "049ae99703f041641568facc0e7c70f210c4efdd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/skipper\/zipball\/eb22a1dbb48f1bc4c9d6efe51c57d326c504deef",
|
||||
"reference": "eb22a1dbb48f1bc4c9d6efe51c57d326c504deef",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/skipper\/zipball\/049ae99703f041641568facc0e7c70f210c4efdd",
|
||||
"reference": "049ae99703f041641568facc0e7c70f210c4efdd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4359,14 +4354,14 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/filesystem": "^5.3",
|
||||
"symfony\/finder": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23",
|
||||
"symplify\/smart-file-system": "^9.4.23",
|
||||
"symplify\/symplify-kernel": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24",
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-24T11:02:20+00:00",
|
||||
"time": "2021-08-02T17:06:20+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4385,7 +4380,7 @@
|
|||
],
|
||||
"description": "Skip files by rule class, directory, file or fnmatch",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/skipper\/tree\/9.4.23"
|
||||
"source": "https:\/\/github.com\/symplify\/skipper\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4401,8 +4396,8 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/smart-file-system",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/smart-file-system.git",
|
||||
|
@ -4425,7 +4420,6 @@
|
|||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-25T21:13:28+00:00",
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4444,7 +4438,7 @@
|
|||
],
|
||||
"description": "Sanitized FileInfo with safe getRealPath() and other handy methods",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/smart-file-system\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/smart-file-system\/tree\/9.4.24"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -4460,8 +4454,8 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/symfony-php-config",
|
||||
"version": "9.4.22",
|
||||
"version_normalized": "9.4.22.0",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/symfony-php-config.git",
|
||||
|
@ -4485,6 +4479,7 @@
|
|||
"symfony\/http-kernel": "^5.3"
|
||||
},
|
||||
"time": "2021-07-12T09:00:48+00:00",
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4509,17 +4504,17 @@
|
|||
},
|
||||
{
|
||||
"name": "symplify\/symplify-kernel",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "9.4.24",
|
||||
"version_normalized": "9.4.24.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/symplify-kernel.git",
|
||||
"reference": "90773fdb6877a29a3ab07751775cff58e1974843"
|
||||
"reference": "8385527edaadedadcb05d06a7455cfda405305ca"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/symplify-kernel\/zipball\/90773fdb6877a29a3ab07751775cff58e1974843",
|
||||
"reference": "90773fdb6877a29a3ab07751775cff58e1974843",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/symplify-kernel\/zipball\/8385527edaadedadcb05d06a7455cfda405305ca",
|
||||
"reference": "8385527edaadedadcb05d06a7455cfda405305ca",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -4527,16 +4522,15 @@
|
|||
"symfony\/console": "^5.3.x-dev",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/autowire-array-parameter": "^9.5",
|
||||
"symplify\/composer-json-manipulator": "^9.5",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/smart-file-system": "^9.5"
|
||||
"symplify\/autowire-array-parameter": "^9.4.24",
|
||||
"symplify\/composer-json-manipulator": "^9.4.24",
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2021-07-24T11:30:20+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2021-08-02T17:06:33+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
@ -4555,7 +4549,7 @@
|
|||
],
|
||||
"description": "Internal Kernel for Symplify packages",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/symplify-kernel\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/symplify-kernel\/tree\/9.4.24"
|
||||
},
|
||||
"install-path": "..\/symplify\/symplify-kernel"
|
||||
},
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20210802\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false) && !interface_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false) && !trait_exists('ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143', false)) {
|
||||
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInitefdcc4d5a886384f0eaef8357453d143');
|
||||
if (!class_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false) && !interface_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false) && !trait_exists('ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2', false)) {
|
||||
spl_autoload_call('RectorPrefix20210802\ComposerAutoloaderInit515a7719282ef2aa9111616aa962f8f2');
|
||||
}
|
||||
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
|
||||
spl_autoload_call('RectorPrefix20210802\Doctrine\Inflector\Inflector');
|
||||
|
@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20210802\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequireefdcc4d5a886384f0eaef8357453d143')) {
|
||||
function composerRequireefdcc4d5a886384f0eaef8357453d143() {
|
||||
return \RectorPrefix20210802\composerRequireefdcc4d5a886384f0eaef8357453d143(...func_get_args());
|
||||
if (!function_exists('composerRequire515a7719282ef2aa9111616aa962f8f2')) {
|
||||
function composerRequire515a7719282ef2aa9111616aa962f8f2() {
|
||||
return \RectorPrefix20210802\composerRequire515a7719282ef2aa9111616aa962f8f2(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
|
6
vendor/symplify/astral/composer.json
vendored
6
vendor/symplify/astral/composer.json
vendored
|
@ -6,13 +6,13 @@
|
|||
"php": ">=8.0",
|
||||
"nette\/utils": "^3.2",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/autowire-array-parameter": "^9.4.23",
|
||||
"symplify\/autowire-array-parameter": "^9.4.24",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"nikic\/php-parser": "^4.11",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"symplify\/easy-testing": "^9.4.23",
|
||||
"symplify\/easy-testing": "^9.4.24",
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
|
@ -92,6 +92,9 @@ final class NodeValueResolver
|
|||
if ($constantName === 'class') {
|
||||
return $className;
|
||||
}
|
||||
if (!\class_exists($className) && !\interface_exists($className)) {
|
||||
return null;
|
||||
}
|
||||
$reflectionClassConstant = new \ReflectionClassConstant($className, $constantName);
|
||||
return $reflectionClassConstant->getValue();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"php": ">=8.0",
|
||||
"nette\/utils": "^3.2",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/package-builder": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/filesystem": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/smart-file-system": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"sebastian\/diff": "^4.0",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
"php": ">=8.0",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/console": "^5.3.x-dev",
|
||||
"symplify\/symplify-kernel": "^9.5"
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"autoload": {
|
||||
|
|
8
vendor/symplify/easy-testing/composer.json
vendored
8
vendor/symplify/easy-testing/composer.json
vendored
|
@ -13,10 +13,10 @@
|
|||
"symfony\/http-kernel": "^5.3",
|
||||
"symfony\/console": "^5.3.x-dev",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/package-builder": "^9.5",
|
||||
"symplify\/console-package-builder": "^9.5",
|
||||
"symplify\/smart-file-system": "^9.5",
|
||||
"symplify\/symplify-kernel": "^9.5"
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/console-package-builder": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24",
|
||||
"symplify\/symplify-kernel": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
|
@ -50,8 +50,12 @@ final class StaticFixtureSplitter
|
|||
public static function createTemporaryFileInfo(\Symplify\SmartFileSystem\SmartFileInfo $fixtureSmartFileInfo, string $prefix, string $fileContent) : \Symplify\SmartFileSystem\SmartFileInfo
|
||||
{
|
||||
$temporaryFilePath = self::createTemporaryPathWithPrefix($fixtureSmartFileInfo, $prefix);
|
||||
$smartFileSystem = new \RectorPrefix20210802\Symplify\SmartFileSystem\SmartFileSystem();
|
||||
$smartFileSystem->dumpFile($temporaryFilePath, $fileContent);
|
||||
$dir = \dirname($temporaryFilePath);
|
||||
if (!\is_dir($dir)) {
|
||||
\mkdir($dir, 0777, \true);
|
||||
}
|
||||
/** @phpstan-ignore-next-line we don't use SmartFileSystem->dump() for performance reasons */
|
||||
\file_put_contents($temporaryFilePath, $fileContent);
|
||||
return new \Symplify\SmartFileSystem\SmartFileInfo($temporaryFilePath);
|
||||
}
|
||||
public static function splitFileInfoToLocalInputAndExpected(\Symplify\SmartFileSystem\SmartFileInfo $smartFileInfo, bool $autoloadTestFixture = \false) : \RectorPrefix20210802\Symplify\EasyTesting\ValueObject\InputFileInfoAndExpected
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/finder": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/symplify-kernel": "^9.5",
|
||||
"symplify\/easy-testing": "^9.5",
|
||||
"symplify\/symplify-kernel": "^9.4.24",
|
||||
"symplify\/easy-testing": "^9.4.24",
|
||||
"nette\/neon": "^3.2"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/config": "^5.3",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5",
|
||||
"symplify\/easy-testing": "^9.4.23"
|
||||
"symplify\/easy-testing": "^9.4.24"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
@ -11,10 +11,10 @@ use RectorPrefix20210802\Symplify\SimplePhpDocParser\ValueObject\PhpDocAttribute
|
|||
*/
|
||||
final class CloningPhpDocNodeVisitor extends \RectorPrefix20210802\Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor
|
||||
{
|
||||
public function enterNode(\PHPStan\PhpDocParser\Ast\Node $origNode) : \PHPStan\PhpDocParser\Ast\Node
|
||||
public function enterNode(\PHPStan\PhpDocParser\Ast\Node $node) : \PHPStan\PhpDocParser\Ast\Node
|
||||
{
|
||||
$node = clone $origNode;
|
||||
$node->setAttribute(\RectorPrefix20210802\Symplify\SimplePhpDocParser\ValueObject\PhpDocAttributeKey::ORIG_NODE, $origNode);
|
||||
return $node;
|
||||
$clonedNode = clone $node;
|
||||
$clonedNode->setAttribute(\RectorPrefix20210802\Symplify\SimplePhpDocParser\ValueObject\PhpDocAttributeKey::ORIG_NODE, $node);
|
||||
return $clonedNode;
|
||||
}
|
||||
}
|
||||
|
|
6
vendor/symplify/skipper/composer.json
vendored
6
vendor/symplify/skipper/composer.json
vendored
|
@ -9,9 +9,9 @@
|
|||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symfony\/finder": "^5.3",
|
||||
"symfony\/filesystem": "^5.3",
|
||||
"symplify\/package-builder": "^9.4.23",
|
||||
"symplify\/symplify-kernel": "^9.4.23",
|
||||
"symplify\/smart-file-system": "^9.4.23"
|
||||
"symplify\/package-builder": "^9.4.24",
|
||||
"symplify\/symplify-kernel": "^9.4.24",
|
||||
"symplify\/smart-file-system": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
"symfony\/console": "^5.3.x-dev",
|
||||
"symfony\/http-kernel": "^5.3",
|
||||
"symfony\/dependency-injection": "^5.3.x-dev",
|
||||
"symplify\/smart-file-system": "^9.5",
|
||||
"symplify\/composer-json-manipulator": "^9.5",
|
||||
"symplify\/autowire-array-parameter": "^9.5",
|
||||
"symplify\/package-builder": "^9.5"
|
||||
"symplify\/smart-file-system": "^9.4.24",
|
||||
"symplify\/composer-json-manipulator": "^9.4.24",
|
||||
"symplify\/autowire-array-parameter": "^9.4.24",
|
||||
"symplify\/package-builder": "^9.4.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
|
|
Loading…
Reference in New Issue
Block a user