mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Updated Rector to commit 997e5f4ae8c388b8a12d16539e8109fe821e8fd6
997e5f4ae8
[TypeDeclaration] Skip intersection with iterable on ReturnTypeDeclarationRector on php 8.1 feature enabled (#3022)
This commit is contained in:
parent
0f38f3753c
commit
b7fb4398da
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Accessory\AccessoryLiteralStringType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
/**
|
||||
* @implements TypeMapperInterface<AccessoryLiteralStringType>
|
||||
*/
|
||||
final class AccessoryLiteralStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
public function getNodeClass() : string
|
||||
{
|
||||
return AccessoryLiteralStringType::class;
|
||||
}
|
||||
/**
|
||||
* @param AccessoryLiteralStringType $type
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
return new IdentifierTypeNode('literal-string');
|
||||
}
|
||||
/**
|
||||
* @param AccessoryLiteralStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
}
|
@ -9,12 +9,23 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
/**
|
||||
* @implements TypeMapperInterface<AccessoryNonEmptyStringType>
|
||||
*/
|
||||
final class AccessoryNonEmptyStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
@ -27,13 +38,16 @@ final class AccessoryNonEmptyStringTypeMapper implements TypeMapperInterface
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
return new IdentifierTypeNode('string');
|
||||
return new IdentifierTypeNode('non-empty-string');
|
||||
}
|
||||
/**
|
||||
* @param AccessoryNonEmptyStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,23 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Accessory\AccessoryNonFalsyStringType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
/**
|
||||
* @implements TypeMapperInterface<AccessoryNonFalsyStringType>
|
||||
*/
|
||||
final class AccessoryNonFalsyStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
@ -27,13 +38,16 @@ final class AccessoryNonFalsyStringTypeMapper implements TypeMapperInterface
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
return new IdentifierTypeNode('string');
|
||||
return new IdentifierTypeNode('non-falsy-string');
|
||||
}
|
||||
/**
|
||||
* @param AccessoryNonFalsyStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,23 @@ use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Accessory\AccessoryNumericStringType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
/**
|
||||
* @implements TypeMapperInterface<AccessoryNumericStringType>
|
||||
*/
|
||||
final class AccessoryNumericStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
@ -27,13 +38,16 @@ final class AccessoryNumericStringTypeMapper implements TypeMapperInterface
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
return new IdentifierTypeNode('string');
|
||||
return new IdentifierTypeNode('numeric-string');
|
||||
}
|
||||
/**
|
||||
* @param AccessoryNumericStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
}
|
||||
|
@ -4,27 +4,35 @@ declare (strict_types=1);
|
||||
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Name;
|
||||
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\ClassStringType;
|
||||
use PHPStan\Type\Generic\GenericClassStringType;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
|
||||
use RectorPrefix202210\Symfony\Contracts\Service\Attribute\Required;
|
||||
/**
|
||||
* @implements TypeMapperInterface<ClassStringType>
|
||||
*/
|
||||
final class ClassStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
|
||||
* @readonly
|
||||
* @var \Rector\PHPStanStaticTypeMapper\TypeMapper\GenericClassStringTypeMapper
|
||||
*/
|
||||
private $phpStanStaticTypeMapper;
|
||||
private $genericClassStringTypeMapper;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(\Rector\PHPStanStaticTypeMapper\TypeMapper\GenericClassStringTypeMapper $genericClassStringTypeMapper, PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->genericClassStringTypeMapper = $genericClassStringTypeMapper;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
@ -37,49 +45,19 @@ final class ClassStringTypeMapper implements TypeMapperInterface
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
$attributeAwareIdentifierTypeNode = new IdentifierTypeNode('class-string');
|
||||
if ($type instanceof GenericClassStringType) {
|
||||
$genericType = $this->resolveGenericObjectType($type);
|
||||
$genericTypeNode = $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($genericType, $typeKind);
|
||||
return new GenericTypeNode($attributeAwareIdentifierTypeNode, [$genericTypeNode]);
|
||||
return $this->genericClassStringTypeMapper->mapToPHPStanPhpDocTypeNode($type, $typeKind);
|
||||
}
|
||||
return $attributeAwareIdentifierTypeNode;
|
||||
return new IdentifierTypeNode('class-string');
|
||||
}
|
||||
/**
|
||||
* @param ClassStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowire(PHPStanStaticTypeMapper $phpStanStaticTypeMapper) : void
|
||||
{
|
||||
$this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper;
|
||||
}
|
||||
private function normalizeType(string $classType) : string
|
||||
{
|
||||
if (\is_a($classType, Expr::class, \true)) {
|
||||
return Expr::class;
|
||||
}
|
||||
if (\is_a($classType, Node::class, \true)) {
|
||||
return Node::class;
|
||||
}
|
||||
return $classType;
|
||||
}
|
||||
/**
|
||||
* @return \PHPStan\Type\ObjectType|\PHPStan\Type\Type
|
||||
*/
|
||||
private function resolveGenericObjectType(GenericClassStringType $genericClassStringType)
|
||||
{
|
||||
$genericType = $genericClassStringType->getGenericType();
|
||||
if (!$genericType instanceof ObjectType) {
|
||||
return $genericType;
|
||||
}
|
||||
$className = $genericType->getClassName();
|
||||
$className = $this->normalizeType($className);
|
||||
return new ObjectType($className);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Name;
|
||||
use PHPStan\PhpDocParser\Ast\Type\GenericTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Generic\GenericClassStringType;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
|
||||
use RectorPrefix202210\Symfony\Contracts\Service\Attribute\Required;
|
||||
/**
|
||||
* @implements TypeMapperInterface<GenericClassStringType>
|
||||
*/
|
||||
final class GenericClassStringTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
|
||||
*/
|
||||
private $phpStanStaticTypeMapper;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
}
|
||||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowire(PHPStanStaticTypeMapper $phpStanStaticTypeMapper) : void
|
||||
{
|
||||
$this->phpStanStaticTypeMapper = $phpStanStaticTypeMapper;
|
||||
}
|
||||
/**
|
||||
* @return class-string<Type>
|
||||
*/
|
||||
public function getNodeClass() : string
|
||||
{
|
||||
return GenericClassStringType::class;
|
||||
}
|
||||
/**
|
||||
* @param GenericClassStringType $type
|
||||
*/
|
||||
public function mapToPHPStanPhpDocTypeNode(Type $type, string $typeKind) : TypeNode
|
||||
{
|
||||
$attributeAwareIdentifierTypeNode = new IdentifierTypeNode('class-string');
|
||||
$genericType = $this->resolveGenericObjectType($type);
|
||||
$genericTypeNode = $this->phpStanStaticTypeMapper->mapToPHPStanPhpDocTypeNode($genericType, $typeKind);
|
||||
return new GenericTypeNode($attributeAwareIdentifierTypeNode, [$genericTypeNode]);
|
||||
}
|
||||
/**
|
||||
* @param GenericClassStringType $type
|
||||
*/
|
||||
public function mapToPhpParserNode(Type $type, string $typeKind) : ?Node
|
||||
{
|
||||
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::SCALAR_TYPES)) {
|
||||
return null;
|
||||
}
|
||||
return new Name('string');
|
||||
}
|
||||
/**
|
||||
* @return \PHPStan\Type\ObjectType|\PHPStan\Type\Type
|
||||
*/
|
||||
private function resolveGenericObjectType(GenericClassStringType $genericClassStringType)
|
||||
{
|
||||
$genericType = $genericClassStringType->getGenericType();
|
||||
if (!$genericType instanceof ObjectType) {
|
||||
return $genericType;
|
||||
}
|
||||
$className = $genericType->getClassName();
|
||||
$className = $this->normalizeType($className);
|
||||
return new ObjectType($className);
|
||||
}
|
||||
private function normalizeType(string $classType) : string
|
||||
{
|
||||
if (\is_a($classType, Expr::class, \true)) {
|
||||
return Expr::class;
|
||||
}
|
||||
if (\is_a($classType, Node::class, \true)) {
|
||||
return Node::class;
|
||||
}
|
||||
return $classType;
|
||||
}
|
||||
}
|
@ -7,9 +7,10 @@ use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Generic\GenericClassStringType;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use PHPStan\Type\IntersectionType;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\ObjectWithoutClassType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\BetterPhpDocParser\ValueObject\Type\BracketsAwareIntersectionTypeNode;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
@ -22,10 +23,6 @@ use RectorPrefix202210\Symfony\Contracts\Service\Attribute\Required;
|
||||
*/
|
||||
final class IntersectionTypeMapper implements TypeMapperInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const STRING = 'string';
|
||||
/**
|
||||
* @var \Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper
|
||||
*/
|
||||
@ -35,9 +32,15 @@ final class IntersectionTypeMapper implements TypeMapperInterface
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PHPStan\Reflection\ReflectionProvider
|
||||
*/
|
||||
private $reflectionProvider;
|
||||
public function __construct(PhpVersionProvider $phpVersionProvider, ReflectionProvider $reflectionProvider)
|
||||
{
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
$this->reflectionProvider = $reflectionProvider;
|
||||
}
|
||||
/**
|
||||
* @required
|
||||
@ -79,19 +82,31 @@ final class IntersectionTypeMapper implements TypeMapperInterface
|
||||
$intersectionedTypeNodes = [];
|
||||
foreach ($type->getTypes() as $intersectionedType) {
|
||||
$resolvedType = $this->phpStanStaticTypeMapper->mapToPhpParserNode($intersectionedType, $typeKind);
|
||||
if ($intersectionedType instanceof GenericClassStringType) {
|
||||
$resolvedTypeName = self::STRING;
|
||||
$resolvedType = new Name(self::STRING);
|
||||
} elseif (!$resolvedType instanceof Name) {
|
||||
return null;
|
||||
} else {
|
||||
$resolvedTypeName = (string) $resolvedType;
|
||||
if (!$resolvedType instanceof Name) {
|
||||
continue;
|
||||
}
|
||||
if (\in_array($resolvedTypeName, [self::STRING, 'object'], \true)) {
|
||||
$resolvedTypeName = (string) $resolvedType;
|
||||
if ($intersectionedType instanceof ObjectWithoutClassType) {
|
||||
return $resolvedType;
|
||||
}
|
||||
/**
|
||||
* $this->reflectionProvider->hasClass($resolvedTypeName) returns true on iterable type
|
||||
* this ensure type is ObjectType early
|
||||
*/
|
||||
if (!$intersectionedType instanceof ObjectType) {
|
||||
continue;
|
||||
}
|
||||
if (!$this->reflectionProvider->hasClass($resolvedTypeName)) {
|
||||
continue;
|
||||
}
|
||||
$intersectionedTypeNodes[] = $resolvedType;
|
||||
}
|
||||
if ($intersectionedTypeNodes === []) {
|
||||
return null;
|
||||
}
|
||||
if (\count($intersectionedTypeNodes) === 1) {
|
||||
return \current($intersectionedTypeNodes);
|
||||
}
|
||||
return new Node\IntersectionType($intersectionedTypeNodes);
|
||||
}
|
||||
private function matchMockObjectType(IntersectionType $intersectionType) : ?FullyQualified
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'af4cf28751f652d2ee1a8319d6cb39bf8614a1c1';
|
||||
public const PACKAGE_VERSION = '997e5f4ae8c388b8a12d16539e8109fe821e8fd6';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-10-28 10:12:28';
|
||||
public const RELEASE_DATE = '2022-10-29 17:49:34';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490::getLoader();
|
||||
return ComposerAutoloaderInitebb455d7d17656555c4fac8d9342a38c::getLoader();
|
||||
|
5
vendor/composer/autoload_classmap.php
vendored
5
vendor/composer/autoload_classmap.php
vendored
@ -1955,6 +1955,7 @@ return array(
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\BoolUnionTypeAnalyzer' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/BoolUnionTypeAnalyzer.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\UnionTypeAnalyzer' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/UnionTypeAnalyzer.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\UnionTypeCommonTypeNarrower' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/UnionTypeCommonTypeNarrower.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryLiteralStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryLiteralStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNonEmptyStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNonEmptyStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNonFalsyStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNonFalsyStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNumericStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNumericStringTypeMapper.php',
|
||||
@ -1965,6 +1966,7 @@ return array(
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\ClassStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/ClassStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\ClosureTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/ClosureTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\FloatTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/FloatTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\GenericClassStringTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/GenericClassStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasMethodTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasMethodTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasOffsetTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasOffsetValueTypeTypeMapper' => $baseDir . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetValueTypeTypeMapper.php',
|
||||
@ -2491,6 +2493,7 @@ return array(
|
||||
'Rector\\Symfony\\Rector\\ClassConstFetch\\ConsoleExceptionToErrorEventConstantRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\ActionSuffixRemoverRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/ActionSuffixRemoverRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\AddRouteAnnotationRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/AddRouteAnnotationRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\CommandConstantReturnCodeRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/CommandConstantReturnCodeRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\ConsoleExecuteReturnIntRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/ConsoleExecuteReturnIntRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\FormTypeGetParentRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/FormTypeGetParentRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\GetRequestRector' => $vendorDir . '/rector/rector-symfony/src/Rector/ClassMethod/GetRequestRector.php',
|
||||
@ -2564,6 +2567,7 @@ return array(
|
||||
'Rector\\Symfony\\Set\\SwiftmailerSetList' => $vendorDir . '/rector/rector-symfony/src/Set/SwiftmailerSetList.php',
|
||||
'Rector\\Symfony\\Set\\SymfonyLevelSetList' => $vendorDir . '/rector/rector-symfony/src/Set/SymfonyLevelSetList.php',
|
||||
'Rector\\Symfony\\Set\\SymfonySetList' => $vendorDir . '/rector/rector-symfony/src/Set/SymfonySetList.php',
|
||||
'Rector\\Symfony\\Set\\TwigLevelSetList' => $vendorDir . '/rector/rector-symfony/src/Set/TwigLevelSetList.php',
|
||||
'Rector\\Symfony\\Set\\TwigSetList' => $vendorDir . '/rector/rector-symfony/src/Set/TwigSetList.php',
|
||||
'Rector\\Symfony\\TypeAnalyzer\\ArrayUnionResponseTypeAnalyzer' => $vendorDir . '/rector/rector-symfony/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php',
|
||||
'Rector\\Symfony\\TypeAnalyzer\\ContainerAwareAnalyzer' => $vendorDir . '/rector/rector-symfony/src/TypeAnalyzer/ContainerAwareAnalyzer.php',
|
||||
@ -2571,6 +2575,7 @@ return array(
|
||||
'Rector\\Symfony\\TypeAnalyzer\\JMSDITypeResolver' => $vendorDir . '/rector/rector-symfony/src/TypeAnalyzer/JMSDITypeResolver.php',
|
||||
'Rector\\Symfony\\TypeDeclaration\\ReturnTypeDeclarationUpdater' => $vendorDir . '/rector/rector-symfony/src/TypeDeclaration/ReturnTypeDeclarationUpdater.php',
|
||||
'Rector\\Symfony\\ValueObjectFactory\\ServiceMapFactory' => $vendorDir . '/rector/rector-symfony/src/ValueObjectFactory/ServiceMapFactory.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyCommandConstantMap' => $vendorDir . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyCommandConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyRequestConstantMap' => $vendorDir . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyRequestConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyResponseConstantMap' => $vendorDir . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyResponseConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\EventNameToClassAndConstant' => $vendorDir . '/rector/rector-symfony/src/ValueObject/EventNameToClassAndConstant.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 ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490
|
||||
class ComposerAutoloaderInitebb455d7d17656555c4fac8d9342a38c
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitebb455d7d17656555c4fac8d9342a38c', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitebb455d7d17656555c4fac8d9342a38c', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit3e77fd98660aed01aa501e8309ba9490::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitebb455d7d17656555c4fac8d9342a38c::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit3e77fd98660aed01aa501e8309ba9490::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitebb455d7d17656555c4fac8d9342a38c::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire3e77fd98660aed01aa501e8309ba9490($fileIdentifier, $file);
|
||||
composerRequireebb455d7d17656555c4fac8d9342a38c($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit3e77fd98660aed01aa501e8309ba9490
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire3e77fd98660aed01aa501e8309ba9490($fileIdentifier, $file)
|
||||
function composerRequireebb455d7d17656555c4fac8d9342a38c($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
13
vendor/composer/autoload_static.php
vendored
13
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
class ComposerStaticInitebb455d7d17656555c4fac8d9342a38c
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -2205,6 +2205,7 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\BoolUnionTypeAnalyzer' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/BoolUnionTypeAnalyzer.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\UnionTypeAnalyzer' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/UnionTypeAnalyzer.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\UnionTypeCommonTypeNarrower' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeAnalyzer/UnionTypeCommonTypeNarrower.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryLiteralStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryLiteralStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNonEmptyStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNonEmptyStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNonFalsyStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNonFalsyStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\AccessoryNumericStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/AccessoryNumericStringTypeMapper.php',
|
||||
@ -2215,6 +2216,7 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\ClassStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/ClassStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\ClosureTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/ClosureTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\FloatTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/FloatTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\GenericClassStringTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/GenericClassStringTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasMethodTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasMethodTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasOffsetTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php',
|
||||
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\HasOffsetValueTypeTypeMapper' => __DIR__ . '/../..' . '/packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetValueTypeTypeMapper.php',
|
||||
@ -2741,6 +2743,7 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
'Rector\\Symfony\\Rector\\ClassConstFetch\\ConsoleExceptionToErrorEventConstantRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\ActionSuffixRemoverRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/ActionSuffixRemoverRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\AddRouteAnnotationRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/AddRouteAnnotationRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\CommandConstantReturnCodeRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/CommandConstantReturnCodeRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\ConsoleExecuteReturnIntRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/ConsoleExecuteReturnIntRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\FormTypeGetParentRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/FormTypeGetParentRector.php',
|
||||
'Rector\\Symfony\\Rector\\ClassMethod\\GetRequestRector' => __DIR__ . '/..' . '/rector/rector-symfony/src/Rector/ClassMethod/GetRequestRector.php',
|
||||
@ -2814,6 +2817,7 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
'Rector\\Symfony\\Set\\SwiftmailerSetList' => __DIR__ . '/..' . '/rector/rector-symfony/src/Set/SwiftmailerSetList.php',
|
||||
'Rector\\Symfony\\Set\\SymfonyLevelSetList' => __DIR__ . '/..' . '/rector/rector-symfony/src/Set/SymfonyLevelSetList.php',
|
||||
'Rector\\Symfony\\Set\\SymfonySetList' => __DIR__ . '/..' . '/rector/rector-symfony/src/Set/SymfonySetList.php',
|
||||
'Rector\\Symfony\\Set\\TwigLevelSetList' => __DIR__ . '/..' . '/rector/rector-symfony/src/Set/TwigLevelSetList.php',
|
||||
'Rector\\Symfony\\Set\\TwigSetList' => __DIR__ . '/..' . '/rector/rector-symfony/src/Set/TwigSetList.php',
|
||||
'Rector\\Symfony\\TypeAnalyzer\\ArrayUnionResponseTypeAnalyzer' => __DIR__ . '/..' . '/rector/rector-symfony/src/TypeAnalyzer/ArrayUnionResponseTypeAnalyzer.php',
|
||||
'Rector\\Symfony\\TypeAnalyzer\\ContainerAwareAnalyzer' => __DIR__ . '/..' . '/rector/rector-symfony/src/TypeAnalyzer/ContainerAwareAnalyzer.php',
|
||||
@ -2821,6 +2825,7 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
'Rector\\Symfony\\TypeAnalyzer\\JMSDITypeResolver' => __DIR__ . '/..' . '/rector/rector-symfony/src/TypeAnalyzer/JMSDITypeResolver.php',
|
||||
'Rector\\Symfony\\TypeDeclaration\\ReturnTypeDeclarationUpdater' => __DIR__ . '/..' . '/rector/rector-symfony/src/TypeDeclaration/ReturnTypeDeclarationUpdater.php',
|
||||
'Rector\\Symfony\\ValueObjectFactory\\ServiceMapFactory' => __DIR__ . '/..' . '/rector/rector-symfony/src/ValueObjectFactory/ServiceMapFactory.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyCommandConstantMap' => __DIR__ . '/..' . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyCommandConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyRequestConstantMap' => __DIR__ . '/..' . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyRequestConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\ConstantMap\\SymfonyResponseConstantMap' => __DIR__ . '/..' . '/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyResponseConstantMap.php',
|
||||
'Rector\\Symfony\\ValueObject\\EventNameToClassAndConstant' => __DIR__ . '/..' . '/rector/rector-symfony/src/ValueObject/EventNameToClassAndConstant.php',
|
||||
@ -3047,9 +3052,9 @@ class ComposerStaticInit3e77fd98660aed01aa501e8309ba9490
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit3e77fd98660aed01aa501e8309ba9490::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit3e77fd98660aed01aa501e8309ba9490::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit3e77fd98660aed01aa501e8309ba9490::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitebb455d7d17656555c4fac8d9342a38c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitebb455d7d17656555c4fac8d9342a38c::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitebb455d7d17656555c4fac8d9342a38c::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
48
vendor/composer/installed.json
vendored
48
vendor/composer/installed.json
vendored
@ -795,17 +795,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan\/phpstan-phpunit",
|
||||
"version": "1.2.1",
|
||||
"version_normalized": "1.2.1.0",
|
||||
"version": "1.2.2",
|
||||
"version_normalized": "1.2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/phpstan\/phpstan-phpunit.git",
|
||||
"reference": "09b5c9ab38d4d601bcff04b4c9240832b86f5dda"
|
||||
"reference": "dea1f87344c6964c607d9076dee42d891f3923f0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan-phpunit\/zipball\/09b5c9ab38d4d601bcff04b4c9240832b86f5dda",
|
||||
"reference": "09b5c9ab38d4d601bcff04b4c9240832b86f5dda",
|
||||
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan-phpunit\/zipball\/dea1f87344c6964c607d9076dee42d891f3923f0",
|
||||
"reference": "dea1f87344c6964c607d9076dee42d891f3923f0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -821,7 +821,7 @@
|
||||
"phpstan\/phpstan-strict-rules": "^1.0",
|
||||
"phpunit\/phpunit": "^9.5"
|
||||
},
|
||||
"time": "2022-10-26T19:38:49+00:00",
|
||||
"time": "2022-10-28T10:23:07+00:00",
|
||||
"type": "phpstan-extension",
|
||||
"extra": {
|
||||
"phpstan": {
|
||||
@ -844,7 +844,7 @@
|
||||
"description": "PHPUnit extensions and rules for PHPStan",
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/phpstan\/phpstan-phpunit\/issues",
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan-phpunit\/tree\/1.2.1"
|
||||
"source": "https:\/\/github.com\/phpstan\/phpstan-phpunit\/tree\/1.2.2"
|
||||
},
|
||||
"install-path": "..\/phpstan\/phpstan-phpunit"
|
||||
},
|
||||
@ -2128,12 +2128,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "644c5a4238b7dc002852900fbf6323bd2fbbd183"
|
||||
"reference": "5f0c972b3cdeff3acfc1a17c9dbed1674023d2ac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/644c5a4238b7dc002852900fbf6323bd2fbbd183",
|
||||
"reference": "644c5a4238b7dc002852900fbf6323bd2fbbd183",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/5f0c972b3cdeff3acfc1a17c9dbed1674023d2ac",
|
||||
"reference": "5f0c972b3cdeff3acfc1a17c9dbed1674023d2ac",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2164,7 +2164,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2022-10-25T09:28:10+00:00",
|
||||
"time": "2022-10-29T10:44:28+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -2346,17 +2346,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony\/console",
|
||||
"version": "v6.1.6",
|
||||
"version_normalized": "6.1.6.0",
|
||||
"version": "v6.1.7",
|
||||
"version_normalized": "6.1.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/console.git",
|
||||
"reference": "7fa3b9cf17363468795e539231a5c91b02b608fc"
|
||||
"reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/7fa3b9cf17363468795e539231a5c91b02b608fc",
|
||||
"reference": "7fa3b9cf17363468795e539231a5c91b02b608fc",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/a1282bd0c096e0bdb8800b104177e2ce404d8815",
|
||||
"reference": "a1282bd0c096e0bdb8800b104177e2ce404d8815",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2391,7 +2391,7 @@
|
||||
"symfony\/lock": "",
|
||||
"symfony\/process": ""
|
||||
},
|
||||
"time": "2022-10-07T08:04:03+00:00",
|
||||
"time": "2022-10-26T21:42:49+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -2425,7 +2425,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.1.6"
|
||||
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.1.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2951,17 +2951,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony\/string",
|
||||
"version": "v6.1.6",
|
||||
"version_normalized": "6.1.6.0",
|
||||
"version": "v6.1.7",
|
||||
"version_normalized": "6.1.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symfony\/string.git",
|
||||
"reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864"
|
||||
"reference": "823f143370880efcbdfa2dbca946b3358c4707e5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/string\/zipball\/7e7e0ff180d4c5a6636eaad57b65092014b61864",
|
||||
"reference": "7e7e0ff180d4c5a6636eaad57b65092014b61864",
|
||||
"url": "https:\/\/api.github.com\/repos\/symfony\/string\/zipball\/823f143370880efcbdfa2dbca946b3358c4707e5",
|
||||
"reference": "823f143370880efcbdfa2dbca946b3358c4707e5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3019,7 +3019,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symfony\/string\/tree\/v6.1.6"
|
||||
"source": "https:\/\/github.com\/symfony\/string\/tree\/v6.1.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
@ -4,6 +4,7 @@ declare (strict_types=1);
|
||||
namespace PHPStan\Rules\PHPUnit;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
use PHPStan\PhpDoc\ResolvedPhpDocBlock;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
||||
use PHPStan\Reflection\ReflectionProvider;
|
||||
@ -51,21 +52,27 @@ class CoversHelper
|
||||
{
|
||||
$errors = [];
|
||||
$covers = (string) $phpDocTag->value;
|
||||
if (strpos($covers, '::') !== \false) {
|
||||
$isMethod = strpos($covers, '::') !== \false;
|
||||
$fullName = $covers;
|
||||
if ($isMethod) {
|
||||
[$className, $method] = explode('::', $covers);
|
||||
} else {
|
||||
$className = $covers;
|
||||
}
|
||||
if ($className === '' && $node instanceof Node\Stmt\ClassMethod && $coversDefaultClass !== null) {
|
||||
$className = (string) $coversDefaultClass->value;
|
||||
$fullName = $className . $covers;
|
||||
}
|
||||
if ($this->reflectionProvider->hasClass($className)) {
|
||||
$class = $this->reflectionProvider->getClass($className);
|
||||
if (isset($method) && $method !== '' && !$class->hasMethod($method)) {
|
||||
$errors[] = RuleErrorBuilder::message(sprintf('@covers value %s references an invalid method.', $covers))->build();
|
||||
$errors[] = RuleErrorBuilder::message(sprintf('@covers value %s references an invalid method.', $fullName))->build();
|
||||
}
|
||||
} else {
|
||||
$errors[] = RuleErrorBuilder::message(sprintf('@covers value %s references an invalid class.', $covers))->build();
|
||||
if (!isset($method) && $this->reflectionProvider->hasFunction(new Name($covers, []), null)) {
|
||||
return $errors;
|
||||
}
|
||||
$errors[] = RuleErrorBuilder::message(sprintf('@covers value %s references an invalid %s.', $fullName, $isMethod ? 'method' : 'class or function'))->build();
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 17bdb82'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main da1013f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9c21f5f'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 6fc267c'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644c5a4'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 17bdb82'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main da1013f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9c21f5f'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 6fc267c'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 5f0c972'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ use Rector\Renaming\ValueObject\MethodCallRename;
|
||||
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;
|
||||
use Rector\Symfony\Rector\Class_\LogoutHandlerToLogoutEventSubscriberRector;
|
||||
use Rector\Symfony\Rector\Class_\LogoutSuccessHandlerToLogoutEventSubscriberRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\CommandConstantReturnCodeRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\RouteCollectionBuilderToRoutingConfiguratorRector;
|
||||
use Rector\Transform\Rector\New_\NewArgToMethodCallRector;
|
||||
use Rector\Transform\Rector\StaticCall\StaticCallToNewRector;
|
||||
@ -34,6 +35,8 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
]);
|
||||
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [new MethodCallRename('Symfony\\Component\\Config\\Definition\\BaseNode', 'getDeprecationMessage', 'getDeprecation'), new MethodCallRename('Symfony\\Component\\DependencyInjection\\Definition', 'getDeprecationMessage', 'getDeprecation'), new MethodCallRename('Symfony\\Component\\DependencyInjection\\Alias', 'getDeprecationMessage', 'getDeprecation')]);
|
||||
$rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, ['Symfony\\Component\\DependencyInjection\\Loader\\Configuraton\\inline' => 'Symfony\\Component\\DependencyInjection\\Loader\\Configuraton\\inline_service', 'Symfony\\Component\\DependencyInjection\\Loader\\Configuraton\\ref' => 'Symfony\\Component\\DependencyInjection\\Loader\\Configuraton\\service']);
|
||||
// see https://symfony.com/blog/new-in-symfony-5-1-misc-improvements-part-1#added-constants-for-command-exit-codes
|
||||
$rectorConfig->rule(CommandConstantReturnCodeRector::class);
|
||||
// https://github.com/symfony/symfony/pull/35308
|
||||
$rectorConfig->ruleWithConfiguration(NewArgToMethodCallRector::class, [new NewArgToMethodCall('Symfony\\Component\\Dotenv\\Dotenv', \true, 'usePutenv')]);
|
||||
$rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_FLOOR', 'NumberFormatter', 'ROUND_FLOOR'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_DOWN', 'NumberFormatter', 'ROUND_DOWN'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_HALF_DOWN', 'NumberFormatter', 'ROUND_HALFDOWN'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_HALF_EVEN', 'NumberFormatter', 'ROUND_HALFEVEN'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_HALFUP', 'NumberFormatter', 'ROUND_HALFUP'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_UP', 'NumberFormatter', 'ROUND_UP'), new RenameClassAndConstFetch('Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer', 'ROUND_CEILING', 'NumberFormatter', 'ROUND_CEILING')]);
|
||||
|
10
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-112.php
vendored
Normal file
10
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-112.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_112]);
|
||||
};
|
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-127.php
vendored
Normal file
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-127.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigLevelSetList;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_127, TwigLevelSetList::UP_TO_TWIG_112]);
|
||||
};
|
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-134.php
vendored
Normal file
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-134.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigLevelSetList;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_134, TwigLevelSetList::UP_TO_TWIG_127]);
|
||||
};
|
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-140.php
vendored
Normal file
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-140.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigLevelSetList;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_140, TwigLevelSetList::UP_TO_TWIG_134]);
|
||||
};
|
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-20.php
vendored
Normal file
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-20.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigLevelSetList;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_20, TwigLevelSetList::UP_TO_TWIG_140]);
|
||||
};
|
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-240.php
vendored
Normal file
11
vendor/rector/rector-symfony/config/sets/twig/level/up-to-twig-240.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202210;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Symfony\Set\TwigLevelSetList;
|
||||
use Rector\Symfony\Set\TwigSetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->sets([TwigSetList::TWIG_240, TwigLevelSetList::UP_TO_TWIG_20]);
|
||||
};
|
@ -251,6 +251,28 @@ Change type in CollectionType from alias string to class reference
|
||||
|
||||
<br>
|
||||
|
||||
## CommandConstantReturnCodeRector
|
||||
|
||||
Changes int return from execute to use Symfony Command constants.
|
||||
|
||||
-
|
||||
class: [`Rector\Symfony\Rector\ClassMethod\CommandConstantReturnCodeRector`](../src/Rector/ClassMethod/CommandConstantReturnCodeRector.php)
|
||||
|
||||
```diff
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
class SomeCommand extends Command
|
||||
{
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
- return 0;
|
||||
+ return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## CommandDescriptionToPropertyRector
|
||||
|
||||
Moves Command description setter to defaultDescription property
|
||||
|
97
vendor/rector/rector-symfony/src/Rector/ClassMethod/CommandConstantReturnCodeRector.php
vendored
Normal file
97
vendor/rector/rector-symfony/src/Rector/ClassMethod/CommandConstantReturnCodeRector.php
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\Reflection\ReflectionResolver;
|
||||
use Rector\Symfony\ValueObject\ConstantMap\SymfonyCommandConstantMap;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* https://symfony.com/blog/new-in-symfony-5-1-misc-improvements-part-1#added-constants-for-command-exit-codes
|
||||
*
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\CommandConstantReturnCodeRector\CommandConstantReturnCodeRectorTest
|
||||
*/
|
||||
final class CommandConstantReturnCodeRector extends AbstractRector
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Reflection\ReflectionResolver
|
||||
*/
|
||||
private $reflectionResolver;
|
||||
public function __construct(ReflectionResolver $reflectionResolver)
|
||||
{
|
||||
$this->reflectionResolver = $reflectionResolver;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Changes int return from execute to use Symfony Command constants.', [new CodeSample(<<<'CODE_SAMPLE'
|
||||
class SomeCommand extends Command
|
||||
{
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
class SomeCommand extends Command
|
||||
{
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [ClassMethod::class];
|
||||
}
|
||||
/**
|
||||
* @param ClassMethod $node
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
{
|
||||
$classReflection = $this->reflectionResolver->resolveClassReflection($node);
|
||||
if (!$classReflection instanceof ClassReflection) {
|
||||
return null;
|
||||
}
|
||||
if (!$classReflection->isSubclassOf('Symfony\\Component\\Console\\Command\\Command')) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->nodeNameResolver->isName($node, 'execute')) {
|
||||
return null;
|
||||
}
|
||||
foreach ($this->betterNodeFinder->findInstancesOfInFunctionLikeScoped($node, [Return_::class]) as $returnNode) {
|
||||
if (!$returnNode->expr instanceof LNumber) {
|
||||
continue;
|
||||
}
|
||||
$returnNode->expr = $this->convertNumberToConstant($returnNode->expr);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* @return \PhpParser\Node\Expr\ClassConstFetch|\PhpParser\Node\Scalar\LNumber
|
||||
*/
|
||||
private function convertNumberToConstant(LNumber $lNumber)
|
||||
{
|
||||
if (!isset(SymfonyCommandConstantMap::RETURN_TO_CONST[$lNumber->value])) {
|
||||
return $lNumber;
|
||||
}
|
||||
return $this->nodeFactory->createShortClassConstFetch('Command', SymfonyCommandConstantMap::RETURN_TO_CONST[$lNumber->value]);
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ declare (strict_types=1);
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
@ -102,8 +103,11 @@ CODE_SAMPLE
|
||||
if ($sensioMethods === null) {
|
||||
return null;
|
||||
}
|
||||
if (\is_string($sensioMethods)) {
|
||||
$sensioMethods = new CurlyListNode([new ArrayItemNode($sensioMethods, null, String_::KIND_DOUBLE_QUOTED)]);
|
||||
}
|
||||
$symfonyMethodsArrayItemNode = $symfonyDoctrineAnnotationTagValueNode->getValue('methods');
|
||||
// value is already filled, do not enter anythign
|
||||
// value is already filled, do not enter anything
|
||||
if ($symfonyMethodsArrayItemNode instanceof ArrayItemNode) {
|
||||
return null;
|
||||
}
|
||||
@ -113,7 +117,7 @@ CODE_SAMPLE
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* @return string[]|null|CurlyListNode
|
||||
* @return string|string[]|null|CurlyListNode
|
||||
*/
|
||||
private function resolveMethods(DoctrineAnnotationTagValueNode $doctrineAnnotationTagValueNode)
|
||||
{
|
||||
|
33
vendor/rector/rector-symfony/src/Set/TwigLevelSetList.php
vendored
Normal file
33
vendor/rector/rector-symfony/src/Set/TwigLevelSetList.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\Set;
|
||||
|
||||
use Rector\Set\Contract\SetListInterface;
|
||||
final class TwigLevelSetList implements SetListInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_112 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-112.php';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_127 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-127.php';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_134 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-134.php';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_140 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-140.php';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_20 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-20.php';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const UP_TO_TWIG_240 = __DIR__ . '/../../config/sets/twig/level/up-to-twig-240.php';
|
||||
}
|
14
vendor/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyCommandConstantMap.php
vendored
Normal file
14
vendor/rector/rector-symfony/src/ValueObject/ConstantMap/SymfonyCommandConstantMap.php
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\ValueObject\ConstantMap;
|
||||
|
||||
final class SymfonyCommandConstantMap
|
||||
{
|
||||
/**
|
||||
* @see https://github.com/symfony/symfony/blob/8e8207bb72d7f2cb8be355994ad2fcfa97c00f74/src/Symfony/Component/Console/Command/Command.php#L36-L38
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
public const RETURN_TO_CONST = [0 => 'SUCCESS', 1 => 'FAILURE', 2 => 'INVALID'];
|
||||
}
|
@ -6,6 +6,8 @@ namespace Rector\Symfony\ValueObject\ConstantMap;
|
||||
final class SymfonyResponseConstantMap
|
||||
{
|
||||
/**
|
||||
* @see https://github.com/symfony/symfony/blob/8e8207bb72d7f2cb8be355994ad2fcfa97c00f74/src/Symfony/Component/HttpFoundation/Response.php#L24-L86
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
public const CODE_TO_CONST = [100 => 'HTTP_CONTINUE', 101 => 'HTTP_SWITCHING_PROTOCOLS', 102 => 'HTTP_PROCESSING', 103 => 'HTTP_EARLY_HINTS', 200 => 'HTTP_OK', 201 => 'HTTP_CREATED', 202 => 'HTTP_ACCEPTED', 203 => 'HTTP_NON_AUTHORITATIVE_INFORMATION', 204 => 'HTTP_NO_CONTENT', 205 => 'HTTP_RESET_CONTENT', 206 => 'HTTP_PARTIAL_CONTENT', 207 => 'HTTP_MULTI_STATUS', 208 => 'HTTP_ALREADY_REPORTED', 226 => 'HTTP_IM_USED', 300 => 'HTTP_MULTIPLE_CHOICES', 301 => 'HTTP_MOVED_PERMANENTLY', 302 => 'HTTP_FOUND', 303 => 'HTTP_SEE_OTHER', 304 => 'HTTP_NOT_MODIFIED', 305 => 'HTTP_USE_PROXY', 306 => 'HTTP_RESERVED', 307 => 'HTTP_TEMPORARY_REDIRECT', 308 => 'HTTP_PERMANENTLY_REDIRECT', 400 => 'HTTP_BAD_REQUEST', 401 => 'HTTP_UNAUTHORIZED', 402 => 'HTTP_PAYMENT_REQUIRED', 403 => 'HTTP_FORBIDDEN', 404 => 'HTTP_NOT_FOUND', 405 => 'HTTP_METHOD_NOT_ALLOWED', 406 => 'HTTP_NOT_ACCEPTABLE', 407 => 'HTTP_PROXY_AUTHENTICATION_REQUIRED', 408 => 'HTTP_REQUEST_TIMEOUT', 409 => 'HTTP_CONFLICT', 410 => 'HTTP_GONE', 411 => 'HTTP_LENGTH_REQUIRED', 412 => 'HTTP_PRECONDITION_FAILED', 413 => 'HTTP_REQUEST_ENTITY_TOO_LARGE', 414 => 'HTTP_REQUEST_URI_TOO_LONG', 415 => 'HTTP_UNSUPPORTED_MEDIA_TYPE', 416 => 'HTTP_REQUESTED_RANGE_NOT_SATISFIABLE', 417 => 'HTTP_EXPECTATION_FAILED', 418 => 'HTTP_I_AM_A_TEAPOT', 421 => 'HTTP_MISDIRECTED_REQUEST', 422 => 'HTTP_UNPROCESSABLE_ENTITY', 423 => 'HTTP_LOCKED', 424 => 'HTTP_FAILED_DEPENDENCY', 425 => 'HTTP_TOO_EARLY', 426 => 'HTTP_UPGRADE_REQUIRED', 428 => 'HTTP_PRECONDITION_REQUIRED', 429 => 'HTTP_TOO_MANY_REQUESTS', 431 => 'HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE', 451 => 'HTTP_UNAVAILABLE_FOR_LEGAL_REASONS', 500 => 'HTTP_INTERNAL_SERVER_ERROR', 501 => 'HTTP_NOT_IMPLEMENTED', 502 => 'HTTP_BAD_GATEWAY', 503 => 'HTTP_SERVICE_UNAVAILABLE', 504 => 'HTTP_GATEWAY_TIMEOUT', 505 => 'HTTP_VERSION_NOT_SUPPORTED', 506 => 'HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL', 507 => 'HTTP_INSUFFICIENT_STORAGE', 508 => 'HTTP_LOOP_DETECTED', 510 => 'HTTP_NOT_EXTENDED', 511 => 'HTTP_NETWORK_AUTHENTICATION_REQUIRED'];
|
||||
|
4
vendor/symfony/console/Application.php
vendored
4
vendor/symfony/console/Application.php
vendored
@ -292,7 +292,9 @@ class Application implements ResetInterface
|
||||
}
|
||||
$alternative = $alternatives[0];
|
||||
$style = new SymfonyStyle($input, $output);
|
||||
$style->block(\sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
|
||||
$output->writeln('');
|
||||
$formattedBlock = (new FormatterHelper())->formatBlock(\sprintf('Command "%s" is not defined.', $name), 'error', \true);
|
||||
$output->writeln($formattedBlock);
|
||||
if (!$style->confirm(\sprintf('Do you want to run "%s" instead? ', $alternative), \false)) {
|
||||
if (null !== $this->dispatcher) {
|
||||
$event = new ConsoleErrorEvent($input, $output, $e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user