Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Coding style #907

@stephanvierkant

Description

@stephanvierkant

I think we should decide on a coding style so we can automate the process of bitching about spaces, indenting, etc. and have a better, cleaner and easier to read and maintain code.

I don't like the Symfony Coding Standard for some reasons. I don't like the Yoda comparison, but that's a personal preference. More important: FriendsOfPHP/PHP-CS-Fixer lacks features squizlabs/PHP_CodeSniffer has.

Some ideas to improve the coding style:

  • Remove useless docblocks like '{class} Constructor', @package annotation
  • Remove @param or @return if native PHP types are using.
  • Type hinting/return types when possible (for now: only only private methods because BC)
  • Use short array syntax
  • Remove redundant else (early return/exit)

I'll work on a PR to improve this, so please let me know if you have a opinion about this matter.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions