-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 - chain calls #217
Comments
Or so: $this->assertFalse(
$validator
->validate($formModel)
->isValid()
); |
@sankaest Do you want to do it and have time for this? |
no problem, I'll do (will check all packages again) it by the end of this week :) |
Great. 👍 But @rustamwin and @darkdef have different opinion. 🤔 Maybe wait for them to share it to avoid extra work. |
Any clues for me regarding style? What exactly should be changed and examples (from->to). @arogachev @rustamwin @darkdef |
I think that reading one line of 80 characters is easier than winding two screens.
|
@darkdef could you please copy here "bad" code style (real example, or give row number in the class) and how it should be restyled. It is always better to show how it should be, otherwise guessing a numbers with lottery will be easier, than writing a code what is good enough. :) And is your example regarding chaining? Also, @samdark should it be advised in some docs and/or accepted by the community? I am confused right now, what is "correct" style. |
Fo example: example1
Vs example2
For me - example1 better. |
Yes, it should be documented. Main rules are:
|
that 120 characters is something new for me (is it final decision?) . In which yiisoft/docs/blob/master/*.md file is (or should this be) mentioned? At least I could not discover it. Need to create new one? It seems to me, that there is quite a lot of different situations, so examples in *.md should help and clarify. |
https://github.com/yiisoft/docs/blob/master/010-code-style.md is a good place to mention it. It wasn't written anywhere else yet. |
@samdark what about such kind of chain? just and example (total length > 120 char).
I mean we count length from
Just to be sure. |
String length included all symbols (including prefix spaces). |
Already fixed. |
Similar to #yiisoft/html#132.
form/tests/Helper/HtmlFormErrorsTest.php
Lines 34 to 36 in d1b8854
Possible fix:
The text was updated successfully, but these errors were encountered: