wordpress-stubs icon indicating copy to clipboard operation
wordpress-stubs copied to clipboard

The nice present: core phpstan tags vs. our phpstan tags in WordPress 6.5

Open szepeviktor opened this issue 2 years ago • 6 comments

Needs change in functionMap.php

@IanDelMar

Stop adding our tag if a tag with the same name is already present.

https://github.com/php-stubs/wordpress-stubs/blob/794559556de631c52b98349890956d306ac38884/visitor.php#L402

What is to be fixed? https://github.com/php-stubs/wordpress-stubs/pull/162/commits/6ef2cf0ab49fdf2c98ebfb53c4c41994e43e573d

szepeviktor avatar Apr 03 '24 15:04 szepeviktor

@johnbillion Has core started adding @phpstan-* tags in 6.5?

szepeviktor avatar Apr 03 '24 15:04 szepeviktor

Nope

johnbillion avatar Apr 03 '24 15:04 johnbillion

So we could have these collisions in earlier stubs? I do not see one in git diff v6.3.3..v6.4.0

szepeviktor avatar Apr 03 '24 15:04 szepeviktor

Some @phpstan-tag annotations are now appearing because someone made changes to the core doc comment, allowing the node visitor to handle the doc comment without functionMap.php.

IanDelMar avatar Apr 03 '24 16:04 IanDelMar

Some @phpstan-tag annotations are now appearing because someone made changes to the core doc comment, allowing the node visitor to handle the doc comment without functionMap.php.

But I thought we had checks for the functionMap.php already in place to catch such things.

IanDelMar avatar Apr 03 '24 16:04 IanDelMar

But I thought we had checks

We need a Superhero, Ian.

szepeviktor avatar Apr 03 '24 16:04 szepeviktor

Do any of you, Superheroes have a idea what to do?

szepeviktor avatar Apr 12 '24 07:04 szepeviktor

I'll have a look on the weekend.

IanDelMar avatar Apr 12 '24 16:04 IanDelMar

Only thing that could happen is that you have a newer version of php parser.

https://github.com/phpDocumentor/ReflectionDocBlock/issues/365

szepeviktor avatar Apr 13 '24 17:04 szepeviktor

It's not the parser...

Compare this from a version with missing phpstan tags image with this from a version with intact phpstan tags image

IanDelMar avatar Apr 13 '24 19:04 IanDelMar