Passed
Push — all-contributors/add-formikaio ( 169f6c )
by
unknown
08:10 queued 05:51
created

RectPatternHor::DoPattern()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 8
ccs 0
cts 8
cp 0
crap 6
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * JPGraph v4.0.3
5
 */
6
7
namespace Amenadiel\JpGraph\Graph;
8
9
/**
10
 * @class RectPatternHor
11
 * // Implements horizontal line pattern
12
 */
13
class RectPatternHor extends RectPattern
14
{
15
    public function __construct($aColor = 'black', $aWeight = 1, $aLineSpacing = 7)
16
    {
17
        parent::__construct($aColor, $aWeight);
18
        $this->linespacing = $aLineSpacing;
19
    }
20
21
    public function DoPattern($aImg)
22
    {
23
        $x0 = $this->rect->x;
24
        $x1 = $this->rect->xe;
25
        $y  = $this->rect->y;
26
        while ($y < $this->rect->ye) {
27
            $aImg->Line($x0, $y, $x1, $y);
28
            $y += $this->linespacing;
29
        }
30
    }
31
}
32