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

Sort mis-ordered modifier in code example #2 #2753

Closed
wants to merge 2 commits into from

Conversation

xSavitar
Copy link

This patch proposes a fix to something that looks like a typo, supposed to be public static ... and not the other way around.

This patch proposes a fix to something that looks like a typo, supposed to be `public static ...` and not the other way around.
@Girgias
Copy link
Member

Girgias commented Sep 10, 2023

That's a PSR convention, PHP doesn't care about the order of modifiers.

It may make sense to align it with PSR, but we don't really follow any coding standard for examples currently, as for a long time this would have been a huge impact for translations.

@Girgias Girgias added the QA Quality Assurance label Sep 10, 2023
@xSavitar
Copy link
Author

That's a PSR convention, PHP doesn't care about the order of modifiers.

It may make sense to align it with PSR, but we don't really follow any coding standard for examples currently, as for a long time this would have been a huge impact for translations.

Right, I was trying to be consistent here with what we already do in most of the other examples (on the site). And also, if it's a PSR, let's just stick to it ☺️

But let me know if you feel strongly opinionated about not changing it.

@salathe
Copy link
Contributor

salathe commented Sep 11, 2023

If this is for consistency's sake, there are other places to change:

language/oop5/basic.xml:    static public function getNew()
reference/classobj/functions/get-called-class.xml:    static public function test() {
reference/funchand/functions/call-user-func-array.xml:    static public function test($name) {
reference/funchand/functions/call-user-func.xml:    static public function test() {
reference/spl/functions/spl-autoload-register.xml:    static public function test($class) {

@kamil-tekiela
Copy link
Member

We strive to be consistent only within a single page. Otherwise we would need to adopt a strict coding standard, but that would be too much of work for translations.

Thank you for this PR, but I don't see the need to merge it. It's fine as it is.

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

Successfully merging this pull request may close these issues.

4 participants