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

Breeding a mule #27

Open
szepeviktor opened this issue Jul 10, 2022 · 4 comments
Open

Breeding a mule #27

szepeviktor opened this issue Jul 10, 2022 · 4 comments

Comments

@szepeviktor
Copy link
Contributor

Could we somehow inject your args into wordpress-stubs?

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Jul 10, 2022

Or all of your args are from WP core? No manual additions?

I'd like to overcome core's referencing policy: https://github.com/WordPress/wordpress-develop/blob/ac3de7c5b3c6eeeda485e00cc0d94da5b40e023f/src/wp-includes/class-wp-customize-manager.php#L4056-L4058

@johnbillion
Copy link
Owner

They're about 90% from WP core, with some manual adjustments to increase the strictness and add extra constraints for PHPStan.

I suppose we could use this Args library to generate the @phpstan-param tags in wordpress-stubs. It would need to replace an existing tag where present.

Related discussion about references:

@szepeviktor
Copy link
Contributor Author

Thank you for the links.
Cc @marekdedic

So in a format like https://github.com/php-stubs/wordpress-stubs/blob/master/functionMap.php we could export array shapes from Args and import into wp-stubs?

@marekdedic
Copy link

Hey. @szepeviktor pointed me to this package, good stuff here!

Feel free to use anything from skaut/wordpress-stubs - I have a bit of a different strategy there compared to php-stubs/wordpress-stubs - strictness over completeness, so I have much more detailed stubs at the cost of not having that many. I think one day we could just merge the two, but feel free to just take anything in the meantime.

Q: What's the benefit of the approach of this library as opposed to stubs? Bundling any 3rd party library in a WordPress plugin is a huge pain, so I'd like to know the benefits.

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