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 event declaration validation #75

Open aik099 opened 9 years ago

aik099 commented 9 years ago

For every event method (method name starts with On and 1st parameter is called $event, class name has EventHandler) we need to:

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