Skip to content
Closed
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
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
"rector/rector-src": "dev-main",
"rector/swiss-knife": "^2.4",
"symfony/config": "^8.1",
"symfony/dependency-injection": "^6.4",
"symfony/dependency-injection": "^7.4",
"symfony/framework-bundle": "^7.4",
"symfony/http-kernel": "^7.4",
"symfony/routing": "^6.4",
"symfony/security-core": "^6.4",
"symfony/security-http": "^6.4",
"symfony/validator": "^6.4",
"symfony/web-link": "^6.4",
"symfony/routing": "^7.4",
"symfony/security-core": "^7.4",
"symfony/security-http": "^7.4",
"symfony/validator": "^7.4",
"symfony/web-link": "^7.4",
"symplify/easy-coding-standard": "^13.2",
"symplify/phpstan-rules": "^14.12",
"symplify/vendor-patches": "^11.5",
Expand Down
4 changes: 4 additions & 0 deletions config/sets/symfony/composer-based.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use Rector\Symfony\CodeQuality\Rector\AttributeGroup\SingleConditionSecurityAttributeToIsGrantedRector;
use Rector\Symfony\CodeQuality\Rector\Class_\SplitAndSecurityAttributeToIsGrantedRector;
use Rector\Symfony\Symfony25\Rector\MethodCall\AddViolationToBuildViolationRector;
use Rector\Symfony\Symfony26\Rector\MethodCall\RedirectToRouteRector;
use Rector\Symfony\Symfony42\Rector\New_\RootNodeTreeBuilderRector;
use Rector\Symfony\Symfony42\Rector\New_\StringToArrayArgumentProcessRector;
use Rector\Symfony\Symfony43\Rector\ClassMethod\EventDispatcherParentConstructRector;
Expand Down Expand Up @@ -95,6 +96,9 @@
// symfony/validator 2.5
AddViolationToBuildViolationRector::class,

// symfony/framework-bundle 2.6
RedirectToRouteRector::class,

// symfony/config 4.2
RootNodeTreeBuilderRector::class,

Expand Down
11 changes: 10 additions & 1 deletion rules/Symfony26/Rector/MethodCall/RedirectToRouteRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@
use PhpParser\Node\Expr\MethodCall;
use Rector\Rector\AbstractRector;
use Rector\Symfony\TypeAnalyzer\ControllerAnalyzer;
use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface;
use Rector\VersionBonding\ValueObject\ComposerPackageConstraint;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

/**
* @changelog https://github.com/symfony/symfony/blob/2.6/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
*
* @see \Rector\Symfony\Tests\Symfony26\Rector\MethodCall\RedirectToRouteRector\RedirectToRouteRectorTest
*/
final class RedirectToRouteRector extends AbstractRector
final class RedirectToRouteRector extends AbstractRector implements ComposerPackageConstraintInterface
{
public function __construct(
private readonly ControllerAnalyzer $controllerAnalyzer
) {
}

public function provideComposerPackageConstraint(): ComposerPackageConstraint
{
return new ComposerPackageConstraint('symfony/framework-bundle', '>=2.6');
}

public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
Expand Down
Loading