AccessPath::flattenAccessPath()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RulerZ\Target\Polyfill;
6
7
use Hoa\Ruler\Model as AST;
8
9
trait AccessPath
10
{
11
    /**
12
     * @param AST\Bag\Context $element Element to visit.
13
     */
14
    private function flattenAccessPath(AST\Bag\Context $element): string
15
    {
16
        $flattenedDimensions = [$element->getId()];
17
        foreach ($element->getDimensions() as $dimension) {
18
            $flattenedDimensions[] = $dimension[1];
19
        }
20
21
        return implode('.', $flattenedDimensions);
22
    }
23
}
24