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

[1.13.3 to 1.14.0] Undefined array key "type" #462

Closed
ruudk opened this issue Dec 12, 2022 · 4 comments · Fixed by #463
Closed

[1.13.3 to 1.14.0] Undefined array key "type" #462

ruudk opened this issue Dec 12, 2022 · 4 comments · Fixed by #463
Labels

Comments

@ruudk
Copy link

ruudk commented Dec 12, 2022

When using PHP-CS-Fixer the following code breaks:

<?php

declare(strict_types=1);

namespace App;

final class SomeTest extends BaseTest
{
    /**
     * @test
     * @doesNotPerformAssertions
     */
    public function it_should_validate() : void
    {

    }
}
        [ErrorException]
        Undefined array key "type"

      {closure}()
        in vendor/friendsofphp/php-cs-fixer/src/Doctrine/Annotation/Tokens.php at line 74
      PhpCsFixer\Doctrine\Annotation\Tokens::createFromDocComment()
        in vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php at line 62
      PhpCsFixer\AbstractDoctrineAnnotationFixer->applyFix()
        in vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php at line 75

I'm seeing this more when using short tags like @doesNotPerformAssertions or @BeforeScenario (Behat).

@derrabus derrabus added the bug label Dec 12, 2022
@icanhazstring
Copy link

This happens here:
1.13.3...1.14.0#diff-862964759d0cedd01fd3a7d6cb59515e2a404c78450e53022018016ab15ef7dfR133-R138

Seems like Lexer::peek() previously returned null in some cases.
Now its an empty array. That is a breaking change right now.

@alcohol
Copy link

alcohol commented Dec 12, 2022

Yeah I just reported the same at PHP-CS-Fixer/PHP-CS-Fixer#6706

@greg0ire
Copy link
Member

That is a breaking change right now.

Not a voluntary one though, it's just me being careless. Don't worry, it's going to be fixed.

@greg0ire
Copy link
Member

Let me know if #463 works for you.

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.

5 participants