Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

PSR Support #77

Closed
SerafimArts opened this issue Oct 25, 2017 · 7 comments
Closed

PSR Support #77

SerafimArts opened this issue Oct 25, 2017 · 7 comments

Comments

@SerafimArts
Copy link
Contributor

SerafimArts commented Oct 25, 2017

What do you think about supporting generally accepted standards? e.g.:

  1. PSR-1 ?
  2. PSR-2 ?
  3. PSR-12 ?

Now the code of Hoa looks ... In Baroque style and reading it is quite problematic %)

@Hywan
Copy link
Member

Hywan commented Oct 27, 2017

Hoa already uses PSR-2 standards. Code is fixed by PHP-CS-Fixer by hoa devtools:cs (see https://github.com/hoaproject/Devtools/tree/master/Resource/PHPCSFixer for all configurations and extra fixers).

@SerafimArts
Copy link
Contributor Author

Hoa already uses PSR-2 standards.

@Hywan Are mutable objects (in particular, the transfer of arguments by reference, like this) are not side effects?

@SerafimArts
Copy link
Contributor Author

SerafimArts commented Oct 27, 2017

Besides:

Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.

The fields declared in this way violate the PSR

@SerafimArts
Copy link
Contributor Author

SerafimArts commented Oct 27, 2017

Other than this, there are other code problems which are not associated with PSR:

  1. https://scrutinizer-ci.com/g/SerafimArts/Compiler/?branch=master
  2. https://scrutinizer-ci.com/g/SerafimArts/Compiler/code-structure/master

=\

@Hywan
Copy link
Member

Hywan commented Oct 27, 2017

Hoa already uses PSR-2 standards.
@Hywan Are mutable objects (in particular, the transfer of arguments by reference, like this) are not side effects?

This algorithm is particularily difficult to implement, and this is an optimisation. I dare you to build the same algorithm with random PSR conventions.

Property names SHOULD NOT be prefixed with a single underscore to indicate protected or private visibility.
The fields declared in this way violate the PSR

“should not”, this is not a “must not” :-). No violation.

Other than this, there are other code problems which are not associated with PSR:

  1. https://scrutinizer-ci.com/g/SerafimArts/Compiler/?branch=master

For what I checked, there are full of jokes, stupid code duplication like this:

screen shot 2017-10-27 at 13 22 38

  1. https://scrutinizer-ci.com/g/SerafimArts/Compiler/code-structure/master

It gives me an empty page, all sections are empty.

I am totally willing to change Hoa's code, but a compiler is difficult to implement and PSR-2 are only about code style, that we respect :-).

@SerafimArts
Copy link
Contributor Author

This algorithm is particularily difficult to implement, and this is an optimisation. I dare you to build the same algorithm with random PSR conventions.

:D

“should not”, this is not a “must not” :-). No violation.

=\

It gives me an empty page, all sections are empty.

The link leads to the overall statistics of the code, the places that can be improved. Maybe permissions =(

image

This is a free service (e.g. you can create the same inspection for hoa) that improves readability and code support. It sometimes buggy, but very often gives very useful advice (for example, about duplicating the code, as you can see).

@Hywan
Copy link
Member

Hywan commented Oct 27, 2017

I think Scrutinizer can help having a better quality for sure. However, this issue is related to PSR. I guess we are OK with that. If you feel a boost of energy, you can open on issue on https://github.com/hoaproject/Central related to Scrutinizer. I am sure some @hoaproject/hoackers will take it :-).

Thanks for the reports!

@Hywan Hywan closed this as completed Oct 27, 2017
@ghost ghost removed the in progress label Oct 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants