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

DefaultMetadataPassTrait::getMetadata()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
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