Closed mbmjertan closed 1 year ago
Can you make a PR with a fix? This shouldn't be a difficult fix to make 🙂
Of course. Which approach would you prefer here? Reverting the namespace as it was previously or fixing it so it both works and looks good?
I'd fix it so that the path is correct. The file should be in the directory.
This would be a good way to approach routes in general - bunch them based on the functionality ('domain'). That way you can have different functionality for, for instance, GET, POST, PUT routes in the same directory.
quick for now I will revert back to review this in the future release
quick for now I will revert back to review this in the future release
What is quick? XD
Not sure why the issue is closed if it's not fixed 😬
I made a quick hack, wrote a reply here, than felt guilty and fixed it the right way. So this is fixed the right way 😉
Describe your bug
When you use
npx create-wp-project
with the Eightshift Libs branch set todevelop
, theLoadMoreRoute
example class is copied over tosrc/Rest/Routes/LoadMoreRoute.php
(while it's in Libs assrc/Rest/Routes/LoadMore/LoadMoreRouteExample.php
), resulting in it having the namespaceProjectName\Rest\Routes\LoadMore
, but without accounting for that in the path.This results in a PSR-4 noncompliance exception, and might be related to 89ea1b7a47fdcccbf66ba447b185950d2ff97f28.
Steps to Reproduce
wp boilerplate init all
or otherwise pull the class into your project usingwp boilerplate
Expected behavior
Site shouldn't be broken with a PSR-4 noncompliance exception 😄
Screenshots, screen recording, code snippet
No response
Environment info
PHP 7.4.30, Libs on
develop
Please confirm that you have searched existing issues in this repo.
Yes
Please confirm that you have searched in our documentation and couldn't find the answer.
Yes
Please confirm that your bug occurs with all plugins uninstalled and with the default WordPress theme active.
Yes