/** * This method checks if a property is not named in camelCase * and emits a rule violation. * * @param PHP_PMD_AbstractNode $node The context source code node. * * @return void */ public function apply(PHP_PMD_AbstractNode $node) { foreach ($node->getProperties() as $property) { if (!preg_match('/^\\$[a-zA-Z][a-zA-Z0-9]*$/', $property->getName())) { $this->addViolation($node, array($property->getName())); } } }