Total Complexity | 6 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class BaseDeductionProcessor |
||
6 | { |
||
7 | public $deduction; |
||
8 | |||
9 | public function __construct($identifier) |
||
10 | { |
||
11 | if (is_string($identifier) || is_int($identifier)) { |
||
12 | $this->deduction = config('open-payroll.models.deduction')::query() |
||
13 | ->with('type') |
||
14 | ->findByHashSlugOrId($identifier); |
||
15 | } |
||
16 | |||
17 | if (is_object($identifier)) { |
||
18 | $this->deduction($identifier); |
||
19 | } |
||
20 | } |
||
21 | |||
22 | public static function make($identifier) |
||
23 | { |
||
24 | return new self($identifier); |
||
25 | } |
||
26 | |||
27 | public function deduction($deduction) |
||
32 | } |
||
33 | |||
34 | abstract public function calculate(); |
||
35 | } |
||
36 |