szepeviktor / phpstan-wordpress

WordPress extensions for PHPStan ⛏️
https://packagist.org/packages/szepeviktor/phpstan-wordpress
MIT License
262 stars 26 forks source link

Add test for WpThemeMagicPropertiesClassReflectionExtension #206

Closed IanDelMar closed 10 months ago

szepeviktor commented 10 months ago

Thank you.

szepeviktor commented 10 months ago

🎵 Payment for the PR: Shamisen plunking 🇯🇵 https://www.youtube.com/watch?v=RcqO0zkyQRo

IanDelMar commented 10 months ago

Very generous! :dancers:

szepeviktor commented 10 months ago

... we could have a non-existent property - but do not worry about it

IanDelMar commented 10 months ago

Do you mean that WP_Theme does not necessarily have all of these properties? I var_dumped all properties of a theme where I removes all info from style.css except the name of the theme. All properties get populated at least with an empty string or an empty array.

IanDelMar commented 10 months ago

But now I'm wondering why we don't add them via the stubs' functionMap.

szepeviktor commented 10 months ago

I've meant to add a line like

['WP_Theme', 'gluegun', false],
IanDelMar commented 10 months ago

https://github.com/szepeviktor/phpstan-wordpress/blob/2e08b58b0060b7f878244a36e5481ff51815bd43/tests/WpThemeMagicPropertiesClassReflectionExtensionTest.php#L25

szepeviktor commented 10 months ago

You see?? The PR is longer than 1 line so viktor is 😵 confuzed!