aik099 / CodingStandard

The PHP_CodeSniffer coding standard I'm using on all of my projects
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Create sniff for tag declaration validation #76

Open aik099 opened 9 years ago

aik099 commented 9 years ago

For every tag method (method name starts with capital letter and 1st parameter is called $params, class name has TagProcessor) we need to:

  1. validate, that method scope is protected (empty scope considered public)
  2. validate, that $params parameter type hint is array
  3. analyze method DocBlock (if present) to:
    • have @return string
    • the $params parameter declaration to be @param array $params Tag params.