/** * This method checks the number of arguments for the given function or method * node against a configured threshold. * * @param PHP_PMD_AbstractNode $node The context source code node. * * @return void */ public function apply(PHP_PMD_AbstractNode $node) { if ($node->getParameterCount() < $this->getIntProperty('minimum')) { return; } $this->addViolation($node); }
/** * This method checks the number of arguments for the given function or method * node against a configured threshold. * * @param PHP_PMD_AbstractNode $node The context source code node. * * @return void */ public function apply(PHP_PMD_AbstractNode $node) { $threshold = $this->getIntProperty('minimum'); $count = $node->getParameterCount(); if ($count < $threshold) { return; } $this->addViolation($node, array($node->getType(), $node->getName(), $count, $threshold)); }