/** * This method checks if a parameter is not named in camelCase * and emits a rule violation. * * @param \PHPMD\AbstractNode $node * @return void */ public function apply(AbstractNode $node) { foreach ($node->getParameters() as $parameter) { if (!preg_match('/^\\$[a-z][a-zA-Z0-9]*$/', $parameter->getName())) { $this->addViolation($node, array($parameter->getName())); } } }