Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
83.33% |
5 / 6 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
Debitor | |
83.33% |
5 / 6 |
|
66.67% |
2 / 3 |
3.04 | |
0.00% |
0 / 1 |
getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
toArray | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
jsonSerialize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package Modules\Accounting\Models |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace Modules\Accounting\Models; |
16 | |
17 | use Modules\Admin\Models\Account; |
18 | |
19 | /** |
20 | * Debitor class. |
21 | * |
22 | * @package Modules\Accounting\Models |
23 | * @license OMS License 2.0 |
24 | * @link https://jingga.app |
25 | * @since 1.0.0 |
26 | */ |
27 | class Debitor |
28 | { |
29 | /** |
30 | * Debitor ID. |
31 | * |
32 | * @var int |
33 | * @since 1.0.0 |
34 | */ |
35 | public int $id = 0; |
36 | |
37 | /** |
38 | * Account. |
39 | * |
40 | * @var null|int|Account |
41 | * @since 1.0.0 |
42 | */ |
43 | public $account = null; |
44 | |
45 | /** |
46 | * Get id. |
47 | * |
48 | * @return int |
49 | * |
50 | * @since 1.0.0 |
51 | */ |
52 | public function getId() : int |
53 | { |
54 | return $this->id; |
55 | } |
56 | |
57 | /** |
58 | * {@inheritdoc} |
59 | */ |
60 | public function toArray() : array |
61 | { |
62 | return [ |
63 | 'id' => $this->id, |
64 | 'account' => $this->account, |
65 | ]; |
66 | } |
67 | |
68 | /** |
69 | * {@inheritdoc} |
70 | */ |
71 | public function jsonSerialize() : mixed |
72 | { |
73 | return $this->toArray(); |
74 | } |
75 | } |