Cell   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 28
ccs 17
cts 17
cp 1
rs 10
c 1
b 0
f 0
wmc 6

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getHeightByContent() 0 12 3
A getWidthByContent() 0 12 3
1
<?php
2
3
namespace VPA\Console\Glyphs;
4
5
class Cell extends GlyphBlock
6
{
7 9
    public function getWidthByContent(int $endOfPreviousSibling = 0): int
8
    {
9 9
        $this->offsetX = $this->__get('paddingLeft') + $this->__get('borderLeft');
10 9
        if ($this->renderedWidth) {
11 8
            return $this->width;
12
        }
13
14 9
        foreach ($this->children as $child) {
15 9
            $this->width = $child->getWidthByContent(0);
16
        }
17 9
        parent::appendWidth($this->width);
18 9
        return $this->width;
19
    }
20
21 10
    public function getHeightByContent(int $endOfPreviousSibling = 0): int
22
    {
23 10
        $deltaTop = $this->__get('paddingTop') + $this->__get('borderTop');
24 10
        $this->offsetY = $deltaTop;
25 10
        if ($this->renderedHeight) {
26 8
            return $this->height;
27
        }
28 10
        foreach ($this->children as $child) {
29 10
            $this->height = $child->getHeightByContent(0);
30
        }
31 10
        parent::appendHeight($this->height);
32 10
        return $this->height;
33
    }
34
}
35