Code Cleanup

Issue #26 resolved
Michael Johnson created an issue

If there are no objections, I'm going to clean up the code to match the specs of PSR-1 and PSR-2. These are both coding guidelines from the PHP Framework Interop Group. Symfony tries to follow the standards and many other large code groups are moving to their recommendations as well.

Most of the recommendations are sensible, and I think it would be beneficial for future contributors and contributions as well. It's easier to read code when it's in a familiar format, and it is likely that use of these recommendations in the wider community will increase over time.

Comments (4)

  1. Michael Johnson reporter

    As a followup, most of the changes would be whitespace (tab to spaces, blank lines) and brace positioning. Also, some things would need documentation added, which is always a good idea anyway. Most of the cleanup can be automated using the PHP Coding Standards Fixer.

  2. Ratan Dhawtal

    Why would I have a objection? I just finished to read the guidelines/specs.

    It seems to pretty good!

  3. Michael Johnson reporter

    Done in four commits because of all the adjustments. Still some stuff left to go such as checking indentation levels, but all the major work is complete.

    Please make sure to check your work using PHP_CodeSniffer and PHP Coding Standards Fixer in dry-run mode before pushing.

    Please note that PHP_CodeSniffer applies extra checks beyond PSR-1 and PSR-2, so you can ignore some of the warnings and errors. I'll be either making additional fixes or creating a config for ignoring some of the checks.

    Also, the Coding Standards Fixer will report unused use declarations for the Symfony CssSelector component. This is fine, it's used implicitly by the Crawler, so don't apply that fixer automatically.

  4. Log in to comment