Test Failed
Pull Request — master (#172)
by
unknown
12:31
created

Receipt::getAcceptancePointSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Sprain\SwissQrBill\PaymentPart\Output\PhpWordOutput\Table;
4
5
use Sprain\SwissQrBill\PaymentPart\Output\PhpWordOutput\PhpWordHelper;
6
use Sprain\SwissQrBill\PaymentPart\Output\PhpWordOutput\Table\Receipt\AmountSection;
7
use PhpOffice\PhpWord\Element\Table;
8
use PhpOffice\PhpWord\Element\Cell;
9
10
class Receipt
11
{
12
    private Table $table;
13
    private Cell $titleSection;
14
    private Cell $informationSection;
15
    private AmountSection $amountSection;
16
    private Cell $acceptancePointSection;
17
18
    public function __construct(Cell $cell)
19
    {
20
        $this->table = $cell->addTable([
21
                'layout' => \PhpOffice\PhpWord\Style\Table::LAYOUT_FIXED,
22
                'width' => PhpWordHelper::percentToPct(100),
23
                'unit' => 'pct',
24
        ]);
25
        $this->titleSection = $this->table->addRow(PhpWordHelper::mmToTwip(Style::TITLE_SECTION_HEIGHT))->addCell();
0 ignored issues
show
Bug introduced by
Sprain\SwissQrBill\Payme...::TITLE_SECTION_HEIGHT) of type double is incompatible with the type integer expected by parameter $height of PhpOffice\PhpWord\Element\Table::addRow(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
        $this->titleSection = $this->table->addRow(/** @scrutinizer ignore-type */ PhpWordHelper::mmToTwip(Style::TITLE_SECTION_HEIGHT))->addCell();
Loading history...
26
        $this->informationSection = $this->table->addRow(PhpWordHelper::mmToTwip(Style::RECEIPT_INFORMATION_SECTION_HEIGHT))->addCell();
27
        $this->amountSection = new AmountSection(
28
            $this->table->addRow(PhpWordHelper::mmToTwip(Style::RECEIPT_AMOUNT_SECTION_HEIGHT))->addCell(),
29
            Style::RECEIPT_CURRENCY_WIDTH,
30
            Style::RECEIPT_AMOUNT_WIDTH,
31
            Style::RECEIPT_AMOUNT_SECTION_HEIGHT
32
        );
33
        $this->acceptancePointSection = $this->table->addRow(PhpWordHelper::mmToTwip(Style::RECEIPT_ACCEPTANCE_SECTION_HEIGHT))->addCell();
34
    }
35
36
    public function getTitleSection() : Cell
37
    {
38
        return $this->titleSection;
39
    }
40
41
    public function getInformationSection() : Cell
42
    {
43
        return $this->informationSection;
44
    }
45
46
    public function getAmountSection() : AmountSection
47
    {
48
        return $this->amountSection;
49
    }
50
51
    public function getAcceptancePointSection() : Cell
52
    {
53
        return $this->acceptancePointSection;
54
    }
55
}
56