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

Namespaces on own line #1712

Merged
merged 1 commit into from Sep 9, 2016
Merged

Conversation

kalenjohnson
Copy link
Sponsor Contributor

namespace declaration on the same line as <?php isn't being used much anymore. Both PHP FIG and Laravel show the namespace on it's own line.

Reference:
http://www.php-fig.org/psr/psr-2/
https://github.com/laravel/laravel/blob/master/app/User.php#L1-L3

namespace declaration on the same line as <?php isn't being used much anymore. Both PHP FIG and Laravel show the namespace on it's own line.

Reference:
http://www.php-fig.org/psr/psr-2/
https://github.com/laravel/laravel/blob/master/app/User.php#L1-L3
@QWp6t
Copy link
Sponsor Member

QWp6t commented Sep 5, 2016

It's still PSR-2 (and PSR-1) compliant, though, to be clear. PSR-2 doesn't require or even suggest that namespaces be on their own line or that <?php be on its own line.

I'm cool either way as far as this goes. I personally like the look of <?php namespace ... more but it's not a big deal.

@kalenjohnson
Copy link
Sponsor Contributor Author

You're right, I thought PSR-2 did say that namespace needs to be on it's own line, but it doesn't, only that it requires a line afterwords.

I personally just haven't seen the namespace on the first line in a long while, threw me off 😂

I'm open to either as well

@QWp6t QWp6t merged commit 2124163 into roots:master Sep 9, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants