Passed
Push — master ( 1b5f50...6e29fd )
by Will
02:32
created

Base::getTableTitle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
namespace SilverShop\Model\Modifiers\Tax;
4
5
use SilverShop\Model\Modifiers\OrderModifier;
6
7
/**
8
 * Base class for creating tax modifiers with.
9
 *
10
 * @property double $Rate
11
 */
12
class Base extends OrderModifier
13
{
14
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
15
        'Rate' => 'Double',
16
    ];
17
18
    private static $defaults = [
0 ignored issues
show
introduced by
The private property $defaults is not used, and could be removed.
Loading history...
19
        'Rate' => 0.15 //15% tax
20
    ];
21
22
    private static $table_name = 'SilverShop_TaxModifier';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
23
24
    private static $singular_name = 'Tax';
0 ignored issues
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
25
26
    private static $plural_name = 'Taxes';
0 ignored issues
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
27
28
    public function getTableTitle()
29
    {
30
        $title = parent::getTableTitle();
31
        if ($this->Rate) {
32
            $title .= ' ' . _t(
33
                __CLASS__ . '.AtRate',
34
                '@ {Rate}%',
35
                '',
36
                ['Rate' => number_format($this->Rate * 100, 1)]
37
            );
38
        }
39
        return $title;
40
    }
41
}
42