1 | <?php |
||
2 | |||
3 | /** |
||
4 | * JPGraph v4.0.3 |
||
5 | */ |
||
6 | |||
7 | namespace Amenadiel\JpGraph\Graph; |
||
8 | |||
9 | use Amenadiel\JpGraph\Util; |
||
10 | |||
11 | /** |
||
12 | * @class RectPatternFactory |
||
13 | * // Factory class for rectangular pattern |
||
14 | */ |
||
15 | class RectPatternFactory |
||
16 | { |
||
17 | public function __construct() |
||
18 | { |
||
19 | // Empty |
||
20 | } |
||
21 | |||
22 | public function Create($aPattern, $aColor, $aWeight = 1) |
||
23 | { |
||
24 | switch ($aPattern) { |
||
25 | case BAND_RDIAG: |
||
26 | $obj = new RectPatternRDiag($aColor, $aWeight); |
||
27 | |||
28 | break; |
||
29 | case BAND_LDIAG: |
||
30 | $obj = new RectPatternLDiag($aColor, $aWeight); |
||
31 | |||
32 | break; |
||
33 | case BAND_SOLID: |
||
34 | $obj = new RectPatternSolid($aColor, $aWeight); |
||
35 | |||
36 | break; |
||
37 | case BAND_VLINE: |
||
38 | $obj = new RectPatternVert($aColor, $aWeight); |
||
39 | |||
40 | break; |
||
41 | case BAND_HLINE: |
||
42 | $obj = new RectPatternHor($aColor, $aWeight); |
||
43 | |||
44 | break; |
||
45 | case BAND_3DPLANE: |
||
46 | $obj = new RectPattern3DPlane($aColor, $aWeight); |
||
47 | |||
48 | break; |
||
49 | case BAND_HVCROSS: |
||
50 | $obj = new RectPatternCross($aColor, $aWeight); |
||
51 | |||
52 | break; |
||
53 | case BAND_DIAGCROSS: |
||
54 | $obj = new RectPatternDiagCross($aColor, $aWeight); |
||
55 | |||
56 | break; |
||
57 | default: |
||
58 | Util\JpGraphError::RaiseL(16003, $aPattern); |
||
59 | //(" Unknown pattern specification ($aPattern)"); |
||
60 | } |
||
61 | |||
62 | return $obj; |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
63 | } |
||
64 | } |
||
65 |