Completed
Pull Request — master (#139)
by Kévin
03:44
created

DefaultMetadataPassTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMetadata() 0 12 2
1
<?php
2
/**
3
 * @author Kévin Gomez https://github.com/K-Phoen <[email protected]>
4
 */
5
6
namespace PHPSA\Analyzer\Helper;
7
8
use PHPSA\Analyzer\Pass\Metadata;
9
10
trait DefaultMetadataPassTrait
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 1
    public static function getMetadata()
16
    {
17 1
        $fqcnParts = explode('\\', get_called_class());
18 1
        $name = Inflector::convertToSnakeCase(end($fqcnParts));
19 1
        $description = null;
20
21 1
        if (defined('self::DESCRIPTION')) {
22 1
            $description = self::DESCRIPTION;
23 1
        }
24
25 1
        return Metadata::create($name, $description);
26
    }
27
}
28