Completed
Pull Request — master (#139)
by Kévin
29:26 queued 14:26
created

DefaultMetadataPassTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 18
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
    public static function getMetadata()
16
    {
17
        $fqcnParts = explode('\\', get_called_class());
18
        $name = Inflector::convertToSnakeCase(end($fqcnParts));
19
        $description = null;
20
21
        if (defined('self::DESCRIPTION')) {
22
            $description = self::DESCRIPTION;
23
        }
24
25
        return Metadata::create($name, $description);
26
    }
27
}
28