szepeviktor / phpstan-wordpress

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

Add WP_LANG_DIR constant #212

Closed swissspidy closed 6 months ago

swissspidy commented 6 months ago

Defined in wp_set_lang_dir().

There is no function to read this constant.

Related:

szepeviktor commented 6 months ago

There is no function to read this constant.

And you should not read that constant.

johnbillion commented 6 months ago

Should this go into dynamicConstantNames too?

szepeviktor commented 6 months ago

Should this go into dynamicConstantNames too?

No, this is always a non-empty string - PHPStan does not care what its value is.

szepeviktor commented 6 months ago

Pascal must have a special plugin that is fiddling with translations...

swissspidy commented 6 months ago

Hehe just working on adding PHPStan to my Preferred Languages plugin :) https://github.com/swissspidy/preferred-languages/pull/961

gritdigital-mibu commented 5 months ago

Having this issue with WP_CONTENT_DIR too. WP core just refers directly to the constant / no function to read. 🫠

gritdigital-mibu commented 5 months ago

There is WP_Filesystem_Base::wp_content_dir() but it's not available where I need it. Anyways, I'm rambling. 😅

swissspidy commented 5 months ago

@gritdigital-mibu Feel free to submit a PR for WP_CONTENT_DIR :)

westonruter commented 5 months ago

Feel free to submit a PR for WP_CONTENT_DIR :)

Proposed in https://github.com/szepeviktor/phpstan-wordpress/pull/216

szepeviktor commented 5 months ago

@gritdigital-mibu You've got a new release. https://github.com/szepeviktor/phpstan-wordpress/releases/tag/v1.3.4

gritdigital-mibu commented 5 months ago

Fab.! Ty ❤️