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

RectPatternVert   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 21
ccs 0
cts 13
cp 0
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A DoPattern() 0 8 2
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * JPGraph v4.0.3
5
 */
6
7
namespace Amenadiel\JpGraph\Graph;
8
9
/**
10
 * @class RectPatternVert
11
 * // Implements vertical line pattern
12
 */
13
class RectPatternVert 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
    /**
22
     * Private methods.
23
     *
24
     * @param mixed $aImg
25
     */
26
    public function DoPattern($aImg)
27
    {
28
        $x  = $this->rect->x;
29
        $y0 = $this->rect->y;
30
        $y1 = $this->rect->ye;
31
        while ($x < $this->rect->xe) {
32
            $aImg->Line($x, $y0, $x, $y1);
33
            $x += $this->linespacing;
34
        }
35
    }
36
}
37