phpstan-wordpress
phpstan-wordpress copied to clipboard
Add WPINC constant
WPINC is not overridable but often used to include core files for functions such as fetch_feed()
Thank you for your PR.
How do you start WordPress without including wp-includes/feed.php?
https://github.com/WordPress/WordPress/blob/83c20455880fae0f11ed823b8eb9d4a8640d0255/wp-settings.php#L231
Oh you're right, the include isn't needed (thanks!). I think we just assumed it was because it is in the example in the dev documentation, I'll add a feedback note mentioning this.
There is a mention about adding WPINC in the WordPress performance lab plugin for their test suite but I'm not sure if it is needed as tests already get excluded from a lot of PHPStan things.
I know there is no core function to get the value of WPINC but I do not want to encourage the users of this package to use WPINC.
Lets close this as I was mistaken for our original needs. I agree it has limited use and encourages bad practices.