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

Code style summary to discuss and configure #176

Open
arogachev opened this issue Oct 17, 2022 · 4 comments
Open

Code style summary to discuss and configure #176

arogachev opened this issue Oct 17, 2022 · 4 comments

Comments

@arogachev
Copy link
Contributor

arogachev commented Oct 17, 2022

Trailing comma after last argument (if they are split into multiple lines):

$this->assertSame(
    ['' => ['Value must be no less than 5.']],
    $result->getErrorMessagesIndexedByPath(),
);

vs

$this->assertSame(
    ['' => ['Value must be no less than 5.']],
    $result->getErrorMessagesIndexedByPath()
);

The first option is already used for array elements, but not automated.

@roxblnfk
Copy link
Member

roxblnfk commented Oct 17, 2022

I like the first.
The same about a function parameters declaration.

@tomaszkane
Copy link

First one. It's more consistent with arrays:

$array = [
'foo',
'boo',
];

and it easier/more friendly to developer - needs less actions when move last item:

  1. move line

vs

  1. move line,
  2. add comma to moved line
  3. remove comma to actual last line

@samdark
Copy link
Member

samdark commented Oct 17, 2022

1st way is good to go.

@arogachev
Copy link
Contributor Author

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

No branches or pull requests

4 participants