-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
42 lines (26 loc) · 936 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require 'vendor/autoload.php';
use KejawenLab\Pajak\PPH21\TaxCalculator;
use KejawenLab\Pajak\PPH21\FirstRateTaxCalculator;
use KejawenLab\Pajak\PPH21\SecondRateTaxCalculator;
use KejawenLab\Pajak\PPH21\ThirdRateTaxCalculator;
use KejawenLab\Pajak\PPH21\FourthRateTaxCalculator;
use Symfony\Component\Console\Output\ConsoleOutput;
$output = new ConsoleOutput();
$first = new FirstRateTaxCalculator();
$second = new SecondRateTaxCalculator();
$second->setPrevious($first);
$third = new ThirdRateTaxCalculator();
$third->setPrevious($second);
$fourth = new FourthRateTaxCalculator();
$fourth->setPrevious($third);
$chain = new TaxCalculator([$first, $second, $third, $fourth]);
$chain->setOutput($output);
$tax = $chain->calculate(45000000);
var_dump($tax);
$tax = $chain->calculate(75000000);
var_dump($tax);
$tax = $chain->calculate(300000000);
var_dump($tax);
$tax = $chain->calculate(750000000);
var_dump($tax);