| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class FormatMoneyAction |
||
| 8 | { |
||
| 9 | protected \DOMNode $node; |
||
| 10 | protected CacheContract $cache; |
||
| 11 | protected string $prefix; |
||
| 12 | protected int $ttl; |
||
| 13 | |||
| 14 | protected float $amount; |
||
| 15 | protected string $currency; |
||
| 16 | |||
| 17 | 2 | public function __construct(\DOMNode $node, CacheContract $cache, string $prefix, ?int $ttl = null) |
|
| 23 | } |
||
| 24 | |||
| 25 | 2 | public function handle(): ?string |
|
| 26 | { |
||
| 27 | 2 | $this->extractParameters($this->node); |
|
| 28 | |||
| 29 | 1 | $formattedAmount = number_format($this->amount); |
|
| 30 | |||
| 31 | 1 | $this->cache->put("{$this->prefix}_amount", "{$this->currency} {$formattedAmount}", $this->ttl); |
|
| 32 | |||
| 33 | 1 | return ''; |
|
| 34 | } |
||
| 35 | |||
| 36 | public function process(?string $answer): void |
||
| 38 | } |
||
| 39 | |||
| 40 | 2 | protected function extractParameters(\DOMNode $node): void |
|
| 55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.