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

[BUG]: Extbase attribute IgnoreValidation gets migrated as 'value' => '...', should be 'argumentName' => '...' #4294

Closed
LeoniePhiline opened this issue Jul 31, 2024 · 0 comments · Fixed by #4295
Labels

Comments

@LeoniePhiline
Copy link

Minimal PHP Code Causing Issue

<?php

declare(strict_types=1);

namespace Repro\Site\Controller;

use Repro\Site\Domain\Model\ExampleModel;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Annotation\IgnoreValidation;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ReproController extends ActionController
{
    /**
     * @IgnoreValidation("example")
     */
    public function exampleAction(
        ExampleModel $example = null
    ): ResponseInterface {
        // ...
        return $this->htmlResponse();
    }
}

Applied rules

Ssch\TYPO3Rector\TYPO312\v0\ExtbaseAnnotationToAttributeRector

Expected Behaviour

<?php

declare(strict_types=1);

namespace Repro\Site\Controller;

use Repro\Site\Domain\Model\ExampleModel;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Annotation\IgnoreValidation;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ReproController extends ActionController
{
    #[IgnoreValidation(['argumentName' => 'example'])]
    public function exampleAction(
        ExampleModel $example = null
    ): ResponseInterface {
        // ...
        return $this->htmlResponse();
    }
}

Actual behavior: #[IgnoreValidation(['value' => 'example'])]

<?php

declare(strict_types=1);

namespace Repro\Site\Controller;

use Repro\Site\Domain\Model\ExampleModel;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Annotation\IgnoreValidation;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ReproController extends ActionController
{
    #[IgnoreValidation(['value' => 'example'])]
    public function exampleAction(
        ExampleModel $example = null
    ): ResponseInterface {
        // ...
        return $this->htmlResponse();
    }
}

Package Version

2.6.4

PHP Version

8.3.9

TYPO3 Version

12.4.17

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant