for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace LSB\NumberingBundle\Service;
use LSB\NumberingBundle\Exception\NumberingGeneratorException;
use LSB\NumberingBundle\Model\Tag;
/**
* Class NumberingPatternTagVerifier
* @package LSB\NumberingBundle\Service
*/
class NumberingPatternTagVerifier
{
* @param array $patternConfig
* @param array $counterConfig
* @throws NumberingGeneratorException
public function verify(array $patternConfig, array $counterConfig): void
$counterConfig
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function verify(array $patternConfig, /** @scrutinizer ignore-unused */ array $counterConfig): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
// verify number tag
preg_match_all(Tag::REG_EXPS[Tag::NUMBER], $patternConfig['pattern'], $matches);
if (empty($matches[0])) {
throw new NumberingGeneratorException(sprintf('No {%s} tag in pattern', Tag::NUMBER));
}
// TODO verify time and object context tag if necessary
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.