Skip to content

Some implemented tags are warned as Unknown #8697

@zonuexe

Description

@zonuexe

Bug report

PHPStan warns when using some @phpstan- prefixed tags.
I haven't noticed this issue for a while as these are not warned with @psalm- compatible tags.

Code snippet that reproduces the problem

<?php declare(strict_types = 1);

/**
 * @phpstan-template-contravariant T
 * @phpstan-immutable
 */
class HelloWorld
{
	/**
	 * @phpstan-readonly
	 * @phpstan-allow-private-mutation
	 * @var mixed
	 */
	public $p1;
	/**
	 * @phpstan-readonly-allow-private-mutation
	 * @var mixed
	 */
	public $p2;
}

https://phpstan.org/r/6c763a2c-8790-4010-a9bd-471b452069e6

Expected output

No errors.

Did PHPStan help you today? Did it make you happy in any way?

Most of my recent blog posts(1, 2) mention you and PHPStan. The source of my discoveries about PHP in the last few years is PHPStan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions