Test Failed
Push — dev ( bbdbb0...17256f )
by Nico
05:36
created

TransferWarpcoreChargeRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSpacecraftId() 0 4 1
A getTargetSpacecraftIds() 0 4 1
A getTransferAmounts() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Spacecraft\Action\TransferWarpcoreCharge;
6
7
use request;
8
use Stu\Lib\Request\CustomControllerHelperTrait;
9
10
final class TransferWarpcoreChargeRequest implements TransferWarpcoreChargeRequestInterface
11
{
12
    use CustomControllerHelperTrait;
13
14
    #[\Override]
15
    public function getSpacecraftId(): int
16
    {
17
        return $this->queryParameter('id')->int()->required();
18
    }
19
20
    #[\Override]
21
    public function getTargetSpacecraftIds(): array
22
    {
23
        return array_map('intval', request::postArray('spacecrafts'));
24
    }
25
26
    #[\Override]
27
    public function getTransferAmounts(): array
28
    {
29
        return array_map('intval', request::postArray('warpcore_transfer'));
30
    }
31
}
32