ExamplePaymentSlipPdf   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 50
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A displayImage() 0 4 1
A setFont() 0 4 1
A setBackground() 0 4 1
A setPosition() 0 4 1
A createCell() 0 11 1
A writePaymentSlipLines() 0 8 1
1
<?php
2
/**
3
 * Swiss Payment Slip PDF
4
 *
5
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
6
 * @copyright 2012-2015 Some nice Swiss guys
7
 * @author Marc Würth <[email protected]>
8
 * @author Manuel Reinhard <[email protected]>
9
 * @author Peter Siska <[email protected]>
10
 * @link https://github.com/ravage84/SwissPaymentSlipPdf/
11
 */
12
13
namespace SwissPaymentSlip\SwissPaymentSlipPdf\Examples;
14
15
use SwissPaymentSlip\SwissPaymentSlipPdf\PaymentSlipPdf;
16
17
/**
18
 * An example implementation of PaymentSlipPdf
19
 */
20
class ExamplePaymentSlipPdf extends PaymentSlipPdf
21
{
22
    protected function displayImage($background)
23
    {
24
        echo sprintf('Display the background image "%s"<br>', $background);
25
    }
26
27
    protected function setFont($fontFamily, $fontSize, $fontColor)
28
    {
29
        echo sprintf('Set the font "%s" "%s" "%s"<br>', $fontFamily, $fontSize, $fontColor);
30
    }
31
32
    protected function setBackground($background)
33
    {
34
        echo sprintf('Set the background "%s"<br>', $background);
35
    }
36
37
    protected function setPosition($posX, $posY)
38
    {
39
        echo sprintf('Set the position to "%s"/"%s"<br>', $posX, $posY);
40
    }
41
42
    protected function createCell($width, $height, $line, $textAlign, $fill)
43
    {
44
        echo sprintf(
45
            'Create a cell; width: "%s"; height: "%s"; line: "%s"; textAlign: "%s"; fill: "%s"<br>',
46
            $width,
47
            $height,
48
            $line,
49
            $textAlign,
50
            $fill
51
        );
52
    }
53
54
    /**
55
     * Normally it is not necessary to overwrite this method
56
     *
57
     * {@inheritDoc}
58
     */
59
    protected function writePaymentSlipLines($elementName, $element)
60
    {
61
        echo sprintf('Write the element "%s"<br>', $elementName);
62
        parent::writePaymentSlipLines($elementName, $element);
63
        echo '<br>';
64
65
        return $this;
66
    }
67
68
69
}
70