public function pass(ClassMethod $methodStmt, Context $context)
{
$functionName = $methodStmt->name;
if (!$functionName) {
return false;
}
if (substr($functionName, 0, 4) !== 'test') {
return false;
}
if ($methodStmt->getDocComment()) {
$phpdoc = $this->docBlockFactory->create($methodStmt->getDocComment()->getText());
if ($phpdoc->hasTag('test')) {
$context->notice('test.annotation', 'Annotation @test is not needed when the method is prefixed with test.', $methodStmt);
return true;
}
}
return false;
}