Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SteuersatzEntity | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
| fromSteuerDbValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| toSteuerDbValue | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Satag\AmicronEntityBundle\Traits; |
| 6 | |
| 7 | /** |
| 8 | * Der Steuersatz wird in Amicron als VARCHAR(2) gespeichert, dieser Trait sorgt für eine passende Konvertierung |
| 9 | */ |
| 10 | trait SteuersatzEntity |
| 11 | { |
| 12 | private function fromSteuerDbValue(?string $value): ?string |
| 13 | { |
| 14 | return $value === null ? null : trim($value); |
| 15 | } |
| 16 | |
| 17 | private function toSteuerDbValue(string|int|null $value): ?string |
| 18 | { |
| 19 | return $value === null ? null : \mb_str_pad((string) $value, 2, ' ', \STR_PAD_LEFT); |
| 20 | } |
| 21 | } |