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

GvDisplayFilesystem::getNodeAttributes()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
rs 10
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