Skip to content

Fix: PHPUnit tags ignored in docblocks with an unknown @psalm tag - #232

Merged
alies-dev merged 23 commits into
psalm:masterfrom
alies-dev:fix/219-unknown-psalm-tag
Nov 9, 2026
Merged

alies-dev merged 23 commits into
psalm:masterfrom
alies-dev:fix/219-unknown-psalm-tag

Conversation

@alies-dev

Copy link
Copy Markdown
Contributor

A docblock with an unknown @psalm-* tag has all its PHPUnit tags (@dataProvider, @depends, @test, @before, ...) ignored, so a missing provider is not reported.

Before

<?php
final class MyTestCase extends TestCase {
    /**
     * @psalm-foo                // InvalidDocblock: Unrecognised annotation @psalm-foo
     * @dataProvider provide     // no issue
     */
    public function testSomething(int $int): void {
        $this->assertSame(1, $int);
    }
}

After

     * @dataProvider provide     // UndefinedMethod: Provider method NS\MyTestCase::provide is not defined

Fixes #219

@alies-dev alies-dev self-assigned this Nov 9, 2026
@alies-dev
alies-dev marked this pull request as ready for review November 9, 2026 22:09
@alies-dev
alies-dev merged commit 3c16ee0 into psalm:master Nov 9, 2026
@alies-dev
alies-dev deleted the fix/219-unknown-psalm-tag branch November 9, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docblocks with an unknown @psalm-* tag are skipped entirely

1 participant