-
Notifications
You must be signed in to change notification settings - Fork 38
Enable PSR-4 for autoload-dev #90
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
Enable PSR-4 for autoload-dev #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
( rebased after #89 has been merged ) |
composer.json
Outdated
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Google\\CloudFunctions\\Tests\\": "tests/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this when we're not autoloading any classes in this namespace, and phpunit doesn't require it?
From composer.org:
Classes needed to run the test suite should not be included in the main autoload rules to avoid polluting the autoloader in production and when other people use your package as a dependency.
I agree with this, but since we're not loading any classes it makes more sense to me to leave this out until we do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this conforms with most standards, but up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just not sure what the purpose of the lines are if they are not autoloading any classes. But If I'm missing something please let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what composer.org says is that if you autoload dependencies they should absolutely not be in the autoload
section if they are test-related, thus the introduction of this autoload-dev
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't autoload test dependencies, which is why I do not think autoload-dev
is needed.
@lucasmichot I didn't mean for the PR to be closed, only for those lines in particular to be removed! The other changes in this pr are great |
Hi @bshaffer - this is my bad actually, the PR closing was not related to your comment |
Enable PSR-4 for
autoload-dev
job https://github.com/GoogleCloudPlatform/functions-framework-php/pull/90/checks?check_run_id=2585735157 is fixed in #89