class NoMissingSpaceInClassAnnotationRule
@implements Rule<InClassNode>
Hierarchy
- class \PHPStan\Rules\PHPUnit\NoMissingSpaceInClassAnnotationRule implements \PHPStan\Rules\Rule
Expanded class hierarchy of NoMissingSpaceInClassAnnotationRule
File
-
vendor/
phpstan/ phpstan-phpunit/ src/ Rules/ PHPUnit/ NoMissingSpaceInClassAnnotationRule.php, line 14
Namespace
PHPStan\Rules\PHPUnitView source
class NoMissingSpaceInClassAnnotationRule implements Rule {
/**
* Covers helper.
*
* @var AnnotationHelper
*/
private $annotationHelper;
public function __construct(AnnotationHelper $annotationHelper) {
$this->annotationHelper = $annotationHelper;
}
public function getNodeType() : string {
return InClassNode::class;
}
public function processNode(Node $node, Scope $scope) : array {
$classReflection = $scope->getClassReflection();
if ($classReflection === null || $classReflection->isSubclassOf(TestCase::class) === false) {
return [];
}
$docComment = $node->getDocComment();
if ($docComment === null) {
return [];
}
return $this->annotationHelper
->processDocComment($docComment);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
NoMissingSpaceInClassAnnotationRule::$annotationHelper | private | property | * Covers helper. * * |
NoMissingSpaceInClassAnnotationRule::getNodeType | public | function | |
NoMissingSpaceInClassAnnotationRule::processNode | public | function | |
NoMissingSpaceInClassAnnotationRule::__construct | public | function |