Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class FastPayId implements IParam |
||
24 | { |
||
25 | /** |
||
26 | * @var int|float|string $value |
||
27 | */ |
||
28 | private $value; |
||
29 | |||
30 | /** |
||
31 | * FastPayId constructor. |
||
32 | * @param int|float|string $fastPayId max. lenght is 15 and can contain only numbers |
||
33 | * |
||
34 | * @throws InvalidArgumentException |
||
35 | */ |
||
36 | 5 | public function __construct($fastPayId) |
|
37 | { |
||
38 | 5 | assertIsInteger($fastPayId, $this->getParamName()); |
|
39 | 2 | assertMaxLength($fastPayId, 15, $this->getParamName()); |
|
40 | 1 | $this->value = $fastPayId; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | 1 | public function __toString(): string |
|
47 | { |
||
48 | 1 | return (string)$this->value; |
|
49 | } |
||
50 | |||
51 | 5 | public function getParamName(): string |
|
52 | { |
||
53 | 5 | return Param::FASTPAYID; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return int|float|string |
||
58 | */ |
||
59 | 1 | public function getValue() |
|
62 | } |
||
63 | } |
||
64 |