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

[Contributing] [Standards] Do not use spaces inside/around offset accessors #6765

Closed

Conversation

phansys
Copy link
Contributor

@phansys phansys commented Jul 23, 2016

Q A
Doc fix? yes
New docs? yes
Applies to all
Fixed tickets N/A

Ref: PHP-CS-Fixer/PHP-CS-Fixer#2089

…essors

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes
| Applies to    | all
| Fixed tickets | N/A

Ref: PHP-CS-Fixer/PHP-CS-Fixer#2089
which return or throw something.
which return or throw something;

* Do not use spaces inside/around offset accessors;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be full stop

@keradus
Copy link
Member

keradus commented Jul 23, 2016

codebase is following the rule (I checked 2.7 branch)
👍 after fixing punctuation

@stof
Copy link
Member

stof commented Jul 25, 2016

👍 this is indeed a rule we apply

@phansys
Copy link
Contributor Author

phansys commented Jul 26, 2016

I'm thinking how to reword this rule in order to express what we really want, by instance:
"Do not use spaces around offset accessors ([ and ]), at least that their surrounding expressions are part of another separated expresion."
Otherwise, it can be currently interpreted as $foo = [] is not good, same for $foo[] = 'value' or $bar = ['foo' => ['baz]].

@keradus
Copy link
Member

keradus commented Jul 26, 2016

Otherwise, it can be currently interpreted as $foo = []

here braces are not offset accessors, they are short array syntax

$foo[] = 'value'

here, indeed, should be no spaces except space after ].

$bar = ['foo' => ['baz]]

again short array syntax


so in general, sth like:
Do not use spaces around[offset accessor and before]offset accessor.

@javiereguiluz
Copy link
Member

👍

Status: reviewed

@wouterj
Copy link
Member

wouterj commented Aug 5, 2016

Thanks Javier.

wouterj added a commit that referenced this pull request Aug 5, 2016
…und offset accessors (phansys)

This PR was squashed before being merged into the 2.7 branch (closes #6765).

Discussion
----------

[Contributing] [Standards] Do not use spaces inside/around offset accessors

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes
| Applies to    | all
| Fixed tickets | N/A

Ref: PHP-CS-Fixer/PHP-CS-Fixer#2089

Commits
-------

e9fa33d [Contributing] [Standards] Do not use spaces inside/around offset accessors
@wouterj wouterj closed this Aug 5, 2016
@phansys phansys deleted the cs_no_spaces_inside_or_around_offset branch August 5, 2016 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants