Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DependencyInjection] Move JMSInject part from AnnotatedPropertyInjectToConstructorInjectionRector to rector-symfony #6247

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\DependencyInjection\NodeAnalyzer\NetteInjectPropertyAnalyzer;
use Rector\DependencyInjection\TypeAnalyzer\InjectTagValueNodeToServiceTypeResolver;
use Rector\FamilyTree\NodeAnalyzer\PropertyUsageAnalyzer;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
Expand All @@ -38,7 +37,7 @@ final class AnnotatedPropertyInjectToConstructorInjectionRector extends Abstract
/**
* @var string[]
*/
private const INJECT_ANNOTATION_CLASSES = ['JMS\DiExtraBundle\Annotation\Inject', 'DI\Annotation\Inject'];
private const INJECT_ANNOTATION_CLASSES = ['DI\Annotation\Inject'];

/**
* @var PropertyUsageAnalyzer
Expand All @@ -50,11 +49,6 @@ final class AnnotatedPropertyInjectToConstructorInjectionRector extends Abstract
*/
private $phpDocTypeChanger;

/**
* @var InjectTagValueNodeToServiceTypeResolver
*/
private $injectTagValueNodeToServiceTypeResolver;

/**
* @var NetteInjectPropertyAnalyzer
*/
Expand All @@ -67,14 +61,12 @@ final class AnnotatedPropertyInjectToConstructorInjectionRector extends Abstract

public function __construct(
PhpDocTypeChanger $phpDocTypeChanger,
InjectTagValueNodeToServiceTypeResolver $injectTagValueNodeToServiceTypeResolver,
PropertyUsageAnalyzer $propertyUsageAnalyzer,
NetteInjectPropertyAnalyzer $netteInjectPropertyAnalyzer,
PhpDocTagRemover $phpDocTagRemover
) {
$this->propertyUsageAnalyzer = $propertyUsageAnalyzer;
$this->phpDocTypeChanger = $phpDocTypeChanger;
$this->injectTagValueNodeToServiceTypeResolver = $injectTagValueNodeToServiceTypeResolver;
$this->netteInjectPropertyAnalyzer = $netteInjectPropertyAnalyzer;
$this->phpDocTagRemover = $phpDocTagRemover;
}
Expand Down Expand Up @@ -147,14 +139,6 @@ public function refactor(Node $node): ?Node
$serviceType = $phpDocInfo->getVarType();
}

if ($serviceType instanceof MixedType) {
$serviceType = $this->injectTagValueNodeToServiceTypeResolver->resolve(
$node,
$phpDocInfo,
$injectTagNode
);
}

if ($serviceType instanceof MixedType) {
return null;
}
Expand Down
Loading