Passed
Push — master ( 1416ae...b5a8b1 )
by Luis
54s queued 13s
created

AttributeAnalyzer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A isAttribute() 0 5 3
1
<?php declare(strict_types=1);
2
/**
3
 * PHP version 8.1
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Parser\Code\Builders;
9
10
use Attribute;
11
use PhpParser\Node\Stmt\Class_;
0 ignored issues
show
Bug introduced by
The type PhpParser\Node\Stmt\Class_ was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
final class AttributeAnalyzer
14
{
15 31
    public function isAttribute(Class_ $class): bool
16
    {
17 31
        return $class->attrGroups !== []
18 31
            && $class->attrGroups[0]->attrs !== []
19 31
            && (string) $class->attrGroups[0]->attrs[0]->name === Attribute::class;
20
    }
21
}
22