mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-29 04:28:11 +02:00
Updated Rector to commit 8733e7335f381c3b426f01d0fa3f24f18522cf8e
8733e7335f
[PHP 8.0] Add support for nested annotation to attributes (#342)
This commit is contained in:
parent
1ca2c218ed
commit
13bedd1bf5
@ -87,7 +87,7 @@ use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
|
||||
/** @var PhpDocInfo $phpDocInfo */
|
||||
$entityTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\ORM\Mapping\Entity');
|
||||
$entityTagValueNode = $phpDocInfo->findOneByAnnotationClass('Doctrine\ORM\Mapping\Entity');
|
||||
if (! $entityTagValueNode instanceof DoctrineAnnotationTagValueNode) {
|
||||
return null;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\SpacelessPhpDocTagNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocNodeVisitor\ChangedPhpDocNodeVisitor;
|
||||
use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
|
||||
use Rector\BetterPhpDocParser\ValueObject\Type\BracketsAwareUnionTypeNode;
|
||||
use Rector\ChangesReporting\Collector\RectorChangeCollector;
|
||||
@ -138,8 +139,12 @@ final class PhpDocInfo
|
||||
*/
|
||||
public function getTagsByName(string $name) : array
|
||||
{
|
||||
$name = $this->annotationNaming->normalizeName($name);
|
||||
// for simple tag names only
|
||||
if (\strpos($name, '\\') !== \false) {
|
||||
return [];
|
||||
}
|
||||
$tags = $this->phpDocNode->getTags();
|
||||
$name = $this->annotationNaming->normalizeName($name);
|
||||
$tags = \array_filter($tags, function (\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode $tag) use($name) {
|
||||
return $tag->name === $name;
|
||||
});
|
||||
@ -216,21 +221,28 @@ final class PhpDocInfo
|
||||
return $this->getTagsByName($name)[0] ?? null;
|
||||
}
|
||||
/**
|
||||
* @param string[] $classes
|
||||
* @param class-string[] $classes
|
||||
*/
|
||||
public function getByAnnotationClasses(array $classes) : ?\Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode
|
||||
{
|
||||
foreach ($classes as $class) {
|
||||
$tagValueNode = $this->getByAnnotationClass($class);
|
||||
$tagValueNode = $this->findOneByAnnotationClass($class);
|
||||
if ($tagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
return $tagValueNode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* @param class-string $class
|
||||
*/
|
||||
public function getByAnnotationClass(string $class) : ?\Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode
|
||||
{
|
||||
return $this->findOneByAnnotationClass($class);
|
||||
}
|
||||
public function hasByAnnotationClass(string $class) : bool
|
||||
{
|
||||
return $this->getByAnnotationClass($class) !== null;
|
||||
return $this->findByAnnotationClass($class) !== [];
|
||||
}
|
||||
/**
|
||||
* @param string[] $annotationsClasses
|
||||
@ -239,35 +251,21 @@ final class PhpDocInfo
|
||||
{
|
||||
return $this->getByAnnotationClasses($annotationsClasses) !== null;
|
||||
}
|
||||
public function getByAnnotationClass(string $desiredClass) : ?\Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode
|
||||
/**
|
||||
* @param class-string $desiredClass
|
||||
*/
|
||||
public function findOneByAnnotationClass(string $desiredClass) : ?\Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode
|
||||
{
|
||||
foreach ($this->phpDocNode->children as $phpDocChildNode) {
|
||||
if (!$phpDocChildNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
// new approach
|
||||
if (!$phpDocChildNode->value instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
$doctrineAnnotationTagValueNode = $phpDocChildNode->value;
|
||||
if ($doctrineAnnotationTagValueNode->hasClassName($desiredClass)) {
|
||||
return $doctrineAnnotationTagValueNode;
|
||||
}
|
||||
// fnmatch
|
||||
$identifierTypeNode = $doctrineAnnotationTagValueNode->identifierTypeNode;
|
||||
if ($this->isFnmatch($identifierTypeNode->name, $desiredClass)) {
|
||||
return $doctrineAnnotationTagValueNode;
|
||||
}
|
||||
// FQN check
|
||||
$resolvedClass = $identifierTypeNode->getAttribute(\Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey::RESOLVED_CLASS);
|
||||
if (!\is_string($resolvedClass)) {
|
||||
continue;
|
||||
}
|
||||
if ($this->isFnmatch($resolvedClass, $desiredClass)) {
|
||||
return $doctrineAnnotationTagValueNode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
$foundTagValueNodes = $this->findByAnnotationClass($desiredClass);
|
||||
return $foundTagValueNodes[0] ?? null;
|
||||
}
|
||||
/**
|
||||
* @param class-string $desiredClass
|
||||
* @return DoctrineAnnotationTagValueNode[]
|
||||
*/
|
||||
public function findByAnnotationClass(string $desiredClass) : array
|
||||
{
|
||||
return $this->filterDoctrineTagValuesNodesINcludingNested($desiredClass);
|
||||
}
|
||||
/**
|
||||
* @param class-string<TNode> $type
|
||||
@ -486,4 +484,72 @@ final class PhpDocInfo
|
||||
}
|
||||
return \fnmatch($desiredValue, $currentValue, \FNM_NOESCAPE);
|
||||
}
|
||||
/**
|
||||
* @return DoctrineAnnotationTagValueNode[]
|
||||
*/
|
||||
private function filterDoctrineTagValuesNodesINcludingNested(string $desiredClass) : array
|
||||
{
|
||||
$desiredDoctrineTagValueNodes = [];
|
||||
$doctrineTagValueNodes = $this->getDoctrineTagValueNodesNestedIncluded();
|
||||
foreach ($doctrineTagValueNodes as $doctrineTagValueNode) {
|
||||
if ($this->isMatchingDesiredClass($doctrineTagValueNode, $desiredClass)) {
|
||||
$desiredDoctrineTagValueNodes[] = $doctrineTagValueNode;
|
||||
}
|
||||
}
|
||||
return $desiredDoctrineTagValueNodes;
|
||||
}
|
||||
private function isMatchingDesiredClass(\Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode $doctrineAnnotationTagValueNode, string $desiredClass) : bool
|
||||
{
|
||||
if ($doctrineAnnotationTagValueNode->hasClassName($desiredClass)) {
|
||||
return \true;
|
||||
}
|
||||
$identifierTypeNode = $doctrineAnnotationTagValueNode->identifierTypeNode;
|
||||
if ($this->isFnmatch($identifierTypeNode->name, $desiredClass)) {
|
||||
return \true;
|
||||
}
|
||||
// FQN check
|
||||
$resolvedClass = $identifierTypeNode->getAttribute(\Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey::RESOLVED_CLASS);
|
||||
return \is_string($resolvedClass) && $this->isFnmatch($resolvedClass, $desiredClass);
|
||||
}
|
||||
/**
|
||||
* @return DoctrineAnnotationTagValueNode[]
|
||||
*/
|
||||
private function getDoctrineTagValueNodesNestedIncluded() : array
|
||||
{
|
||||
$doctrineTagValueNodes = [];
|
||||
foreach ($this->phpDocNode->children as $phpDocChildNode) {
|
||||
if (!$phpDocChildNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
if (!$phpDocChildNode->value instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
$doctrineTagValueNodes[] = $phpDocChildNode->value;
|
||||
}
|
||||
// search nested tags too
|
||||
$nestedDoctrineTagValueNodes = $this->resolveNestedDoctrineTagValueNodes($doctrineTagValueNodes);
|
||||
return \array_merge($doctrineTagValueNodes, $nestedDoctrineTagValueNodes);
|
||||
}
|
||||
/**
|
||||
* @param DoctrineAnnotationTagValueNode[] $doctrineTagValueNodes
|
||||
* @return DoctrineAnnotationTagValueNode[]
|
||||
*/
|
||||
private function resolveNestedDoctrineTagValueNodes(array $doctrineTagValueNodes) : array
|
||||
{
|
||||
$nestedDoctrineAnnotationTagValueNodes = [];
|
||||
foreach ($doctrineTagValueNodes as $doctrineTagValueNode) {
|
||||
foreach ($doctrineTagValueNode->getValues() as $nestedTagValue) {
|
||||
if (!$nestedTagValue instanceof \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode) {
|
||||
continue;
|
||||
}
|
||||
foreach ($nestedTagValue->getValues() as $nestedTagValueNestedValue) {
|
||||
if (!$nestedTagValueNestedValue instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
$nestedDoctrineAnnotationTagValueNodes[] = $nestedTagValueNestedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $nestedDoctrineAnnotationTagValueNodes;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ final class PhpDocClassRenamer
|
||||
*/
|
||||
private function processAssertChoiceTagValueNode(array $oldToNewClasses, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo) : void
|
||||
{
|
||||
$assertChoiceTagValueNode = $phpDocInfo->getByAnnotationClass('Symfony\\Component\\Validator\\Constraints\\Choice');
|
||||
$assertChoiceTagValueNode = $phpDocInfo->findOneByAnnotationClass('Symfony\\Component\\Validator\\Constraints\\Choice');
|
||||
if (!$assertChoiceTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
return;
|
||||
}
|
||||
@ -68,7 +68,7 @@ final class PhpDocClassRenamer
|
||||
*/
|
||||
private function processSerializerTypeTagValueNode(array $oldToNewClasses, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo) : void
|
||||
{
|
||||
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass('JMS\\Serializer\\Annotation\\Type');
|
||||
$doctrineAnnotationTagValueNode = $phpDocInfo->findOneByAnnotationClass('JMS\\Serializer\\Annotation\\Type');
|
||||
if (!$doctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
return;
|
||||
}
|
||||
|
@ -11,9 +11,7 @@ use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
|
||||
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
||||
@ -99,9 +97,14 @@ CODE_SAMPLE
|
||||
if (!$phpDocInfo instanceof \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo) {
|
||||
return null;
|
||||
}
|
||||
$tags = $phpDocInfo->getAllTags();
|
||||
$hasNewAttrGroups = $this->processApplyAttrGroups($tags, $phpDocInfo, $node);
|
||||
if ($hasNewAttrGroups) {
|
||||
$originalAttrGroupsCount = \count($node->attrGroups);
|
||||
// 1. generic tags
|
||||
$this->processGenericTags($phpDocInfo, $node);
|
||||
// 2. Doctrine annotation classes
|
||||
$this->processDoctrineAnnotationClasses($phpDocInfo, $node);
|
||||
$currentAttrGroupsCount = \count($node->attrGroups);
|
||||
// something has changed
|
||||
if ($originalAttrGroupsCount !== $currentAttrGroupsCount) {
|
||||
return $node;
|
||||
}
|
||||
return null;
|
||||
@ -115,39 +118,6 @@ CODE_SAMPLE
|
||||
\RectorPrefix20210630\Webmozart\Assert\Assert::allIsInstanceOf($annotationsToAttributes, \Rector\Php80\ValueObject\AnnotationToAttribute::class);
|
||||
$this->annotationsToAttributes = $annotationsToAttributes;
|
||||
}
|
||||
/**
|
||||
* @param array<PhpDocTagNode> $tags
|
||||
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $node
|
||||
*/
|
||||
private function processApplyAttrGroups(array $tags, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, $node) : bool
|
||||
{
|
||||
$hasNewAttrGroups = \false;
|
||||
foreach ($tags as $tag) {
|
||||
foreach ($this->annotationsToAttributes as $annotationToAttribute) {
|
||||
$annotationToAttributeTag = $annotationToAttribute->getTag();
|
||||
if ($this->isFoundGenericTag($phpDocInfo, $tag->value, $annotationToAttributeTag)) {
|
||||
// 1. remove php-doc tag
|
||||
$this->phpDocTagRemover->removeByName($phpDocInfo, $annotationToAttributeTag);
|
||||
// 2. add attributes
|
||||
$node->attrGroups[] = $this->phpAttributeGroupFactory->createFromSimpleTag($annotationToAttribute);
|
||||
$hasNewAttrGroups = \true;
|
||||
continue 2;
|
||||
}
|
||||
if ($this->shouldSkip($tag->value, $phpDocInfo, $annotationToAttributeTag)) {
|
||||
continue;
|
||||
}
|
||||
// 1. remove php-doc tag
|
||||
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $tag->value);
|
||||
// 2. add attributes
|
||||
/** @var DoctrineAnnotationTagValueNode $tagValue */
|
||||
$tagValue = $tag->value;
|
||||
$node->attrGroups[] = $this->phpAttributeGroupFactory->create($tagValue, $annotationToAttribute);
|
||||
$hasNewAttrGroups = \true;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
return $hasNewAttrGroups;
|
||||
}
|
||||
private function isFoundGenericTag(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode $phpDocTagValueNode, string $annotationToAttributeTag) : bool
|
||||
{
|
||||
if (!$phpDocInfo->hasByName($annotationToAttributeTag)) {
|
||||
@ -155,12 +125,41 @@ CODE_SAMPLE
|
||||
}
|
||||
return $phpDocTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
||||
}
|
||||
private function shouldSkip(\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode $phpDocTagValueNode, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, string $annotationToAttributeTag) : bool
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction|\PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\Class_ $node
|
||||
*/
|
||||
private function processGenericTags(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, $node) : void
|
||||
{
|
||||
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass($annotationToAttributeTag);
|
||||
if ($phpDocTagValueNode !== $doctrineAnnotationTagValueNode) {
|
||||
return \true;
|
||||
foreach ($phpDocInfo->getAllTags() as $phpDocTagNode) {
|
||||
foreach ($this->annotationsToAttributes as $annotationToAttribute) {
|
||||
$desiredTag = $annotationToAttribute->getTag();
|
||||
// not a basic one
|
||||
if (\strpos($desiredTag, '\\') !== \false) {
|
||||
continue;
|
||||
}
|
||||
if (!$this->isFoundGenericTag($phpDocInfo, $phpDocTagNode->value, $desiredTag)) {
|
||||
continue;
|
||||
}
|
||||
// 1. remove php-doc tag
|
||||
$this->phpDocTagRemover->removeByName($phpDocInfo, $desiredTag);
|
||||
// 2. add attributes
|
||||
$node->attrGroups[] = $this->phpAttributeGroupFactory->createFromSimpleTag($annotationToAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction|\PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\Class_ $node
|
||||
*/
|
||||
private function processDoctrineAnnotationClasses(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, $node) : void
|
||||
{
|
||||
foreach ($this->annotationsToAttributes as $annotationToAttribute) {
|
||||
$doctrineAnnotationTagValueNodes = $phpDocInfo->findByAnnotationClass($annotationToAttribute->getTag());
|
||||
foreach ($doctrineAnnotationTagValueNodes as $doctrineAnnotationTagValueNode) {
|
||||
// 1. remove php-doc tag
|
||||
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $doctrineAnnotationTagValueNode);
|
||||
// 2. add attributes
|
||||
$node->attrGroups[] = $this->phpAttributeGroupFactory->create($doctrineAnnotationTagValueNode, $annotationToAttribute);
|
||||
}
|
||||
}
|
||||
return !$phpDocTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ CODE_SAMPLE
|
||||
if (!$propertyPhpDocInfo instanceof \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo) {
|
||||
continue;
|
||||
}
|
||||
$requiredDoctrineAnnotationTagValueNode = $propertyPhpDocInfo->getByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Required');
|
||||
$requiredDoctrineAnnotationTagValueNode = $propertyPhpDocInfo->findOneByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Required');
|
||||
if (!$requiredDoctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
@ -175,7 +175,7 @@ CODE_SAMPLE
|
||||
}
|
||||
private function decorateTarget(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, \PhpParser\Node\AttributeGroup $attributeGroup) : void
|
||||
{
|
||||
$targetDoctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Target');
|
||||
$targetDoctrineAnnotationTagValueNode = $phpDocInfo->findOneByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Target');
|
||||
if (!$targetDoctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
return;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ final class DoctrineColumnPropertyTypeInferer implements \Rector\TypeDeclaration
|
||||
public function inferProperty(\PhpParser\Node\Stmt\Property $property) : ?\PHPStan\Type\Type
|
||||
{
|
||||
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
|
||||
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\\ORM\\Mapping\\Column');
|
||||
$doctrineAnnotationTagValueNode = $phpDocInfo->findOneByAnnotationClass('Doctrine\\ORM\\Mapping\\Column');
|
||||
if (!$doctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
|
||||
return null;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ final class DoctrineRelationPropertyTypeInferer implements \Rector\TypeDeclarati
|
||||
}
|
||||
$toOneRelationTagValueNode = $phpDocInfo->getByAnnotationClasses(['Doctrine\\ORM\\Mapping\\ManyToOne', 'Doctrine\\ORM\\Mapping\\OneToOne']);
|
||||
if ($toOneRelationTagValueNode !== null) {
|
||||
$joinDoctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\\ORM\\Mapping\\JoinColumn');
|
||||
$joinDoctrineAnnotationTagValueNode = $phpDocInfo->findOneByAnnotationClass('Doctrine\\ORM\\Mapping\\JoinColumn');
|
||||
return $this->processToOneRelation($property, $toOneRelationTagValueNode, $joinDoctrineAnnotationTagValueNode);
|
||||
}
|
||||
return null;
|
||||
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '4c4049217a62b4e2b7e0cce84598401776f4e90d';
|
||||
public const PACKAGE_VERSION = '8733e7335f381c3b426f01d0fa3f24f18522cf8e';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-06-30 15:30:03';
|
||||
public const RELEASE_DATE = '2021-06-30 21:39:28';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210630\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1::getLoader();
|
||||
return ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a::getLoader();
|
||||
|
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 ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1
|
||||
class ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a', '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\ComposerStaticInit899d15a0efd0d91db9710e746e7250b1::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitbe01407f7252808dc39969638e2b838a::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,19 +42,19 @@ class ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit899d15a0efd0d91db9710e746e7250b1::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitbe01407f7252808dc39969638e2b838a::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire899d15a0efd0d91db9710e746e7250b1($fileIdentifier, $file);
|
||||
composerRequirebe01407f7252808dc39969638e2b838a($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire899d15a0efd0d91db9710e746e7250b1($fileIdentifier, $file)
|
||||
function composerRequirebe01407f7252808dc39969638e2b838a($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit899d15a0efd0d91db9710e746e7250b1
|
||||
class ComposerStaticInitbe01407f7252808dc39969638e2b838a
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -3841,9 +3841,9 @@ class ComposerStaticInit899d15a0efd0d91db9710e746e7250b1
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit899d15a0efd0d91db9710e746e7250b1::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit899d15a0efd0d91db9710e746e7250b1::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit899d15a0efd0d91db9710e746e7250b1::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitbe01407f7252808dc39969638e2b838a::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitbe01407f7252808dc39969638e2b838a::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitbe01407f7252808dc39969638e2b838a::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -21,8 +21,8 @@ if (!class_exists('SomeTestCase', false) && !interface_exists('SomeTestCase', fa
|
||||
if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) {
|
||||
spl_autoload_call('RectorPrefix20210630\CheckoutEntityFactory');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1', false) && !interface_exists('ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1', false) && !trait_exists('ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1', false)) {
|
||||
spl_autoload_call('RectorPrefix20210630\ComposerAutoloaderInit899d15a0efd0d91db9710e746e7250b1');
|
||||
if (!class_exists('ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a', false) && !interface_exists('ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a', false) && !trait_exists('ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a', false)) {
|
||||
spl_autoload_call('RectorPrefix20210630\ComposerAutoloaderInitbe01407f7252808dc39969638e2b838a');
|
||||
}
|
||||
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
|
||||
spl_autoload_call('RectorPrefix20210630\Doctrine\Inflector\Inflector');
|
||||
@ -3320,9 +3320,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20210630\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire899d15a0efd0d91db9710e746e7250b1')) {
|
||||
function composerRequire899d15a0efd0d91db9710e746e7250b1() {
|
||||
return \RectorPrefix20210630\composerRequire899d15a0efd0d91db9710e746e7250b1(...func_get_args());
|
||||
if (!function_exists('composerRequirebe01407f7252808dc39969638e2b838a')) {
|
||||
function composerRequirebe01407f7252808dc39969638e2b838a() {
|
||||
return \RectorPrefix20210630\composerRequirebe01407f7252808dc39969638e2b838a(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user