Completed
Push — master ( 791ddf...de8e1b )
by Pol
14:00
created

GvDisplayFilesystem   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getNodeAttributes() 0 9 2
1
<?php
2
3
namespace drupol\phpvfs\Exporter;
4
5
use drupol\phptree\Exporter\GvConvert;
6
use drupol\phptree\Node\NodeInterface;
7
use drupol\phpvfs\Utils\Path;
8
9
/**
10
 * Class GvDisplayFilesystem.
11
 */
12
class GvDisplayFilesystem extends GvConvert
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected function getNodeAttributes(NodeInterface $node): array
18
    {
19
        $attributes = parent::getNodeAttributes($node);
20
21
        if (!\array_key_exists('label', $attributes)) {
22
            $attributes['label'] = Path::fromString($attributes['id']);
23
        }
24
25
        return $attributes;
26
    }
27
28
}
29