Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluding stuff #1

Open
szepeviktor opened this issue Dec 19, 2019 · 7 comments
Open

Excluding stuff #1

szepeviktor opened this issue Dec 19, 2019 · 7 comments

Comments

@szepeviktor
Copy link

szepeviktor commented Dec 19, 2019

  • deprecated code
  • compat. code
  • views

@paulthewalton How about picking what is unnecessary and releasing it on https://github.com/php-stubs ?

See core and WC finder.php.

@Ciantic
Copy link

Ciantic commented Mar 14, 2020

Yea, this package does not play well with the wordpress stubs, for instance this acf stub should not redeclare:

function determine_locale()
{
}

Now it's unusable in phpstan with WordPress stubs.

@szepeviktor
Copy link
Author

szepeviktor commented Mar 14, 2020

It is not so easy as that function has no own file but lives in includes/l10n.php

@paulthewalton
Copy link
Owner

paulthewalton commented Apr 9, 2020

I've done a bit of this over at acf-pro-stubs, specifically:

I was unsure about not including the compat stuff in advanced-custom-fields-pro\includes\compatibility.php, mostly because I'm still not very familiar with the ACF code base.

Also, i removed determine_locale from the generated stubs file via regex, which can be expanded to include any other functions, but seems a little inelegant if nothing else.

Full disclosure, I'm not currently using PHPStan, I just made this repo to use with Intelephense, so if there are other functions that aren't playing well with PHPStan, I'll happily add them to the list.

@paulthewalton
Copy link
Owner

Closed the issue by accident. WRT my above comment, I'll be moving some of those changes over to this repo in the next little while.

@szepeviktor
Copy link
Author

Okay! Thank you.

@szepeviktor
Copy link
Author

szepeviktor commented Apr 10, 2020

determine_locale

Mine is

sed -e '/^function determine_locale()/{N;N;d}' -i acf-stubs-${PLUGIN_VERSION}.php

but it only removes the empty function leaving its docblock there.

@szepeviktor
Copy link
Author

szepeviktor commented Apr 10, 2020

Actually the proper solution is to ask @elliotcondon to put it in a separate core-functions.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants