Passed
Push — dev ( 737777...096a7e )
by Janko
05:19
created

CreateOfferRequest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 38
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getStorageId() 0 4 1
A getGiveCommodityId() 0 4 1
A getWantedCommodityId() 0 4 1
A getGiveAmount() 0 4 1
A getWantedAmount() 0 4 1
A getOfferAmount() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Trade\Action\CreateOffer;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Stu\Lib\Request\CustomControllerHelperTrait;
9
10
final class CreateOfferRequest implements CreateOfferRequestInterface
11
{
12
    use CustomControllerHelperTrait;
13
14 1
    #[Override]
15
    public function getStorageId(): int
16
    {
17 1
        return $this->bodyParameter('storid')->int()->required();
18
    }
19
20 1
    #[Override]
21
    public function getWantedCommodityId(): int
22
    {
23 1
        return $this->bodyParameter('wgid')->int()->required();
24
    }
25
26 1
    #[Override]
27
    public function getWantedAmount(): int
28
    {
29 1
        return $this->bodyParameter('wcount')->int()->defaultsTo(0);
30
    }
31
32 1
    #[Override]
33
    public function getGiveCommodityId(): int
34
    {
35 1
        return $this->bodyParameter('ggid')->int()->required();
36
    }
37
38 1
    #[Override]
39
    public function getGiveAmount(): int
40
    {
41 1
        return $this->bodyParameter('gcount')->int()->defaultsTo(0);
42
    }
43
44 1
    #[Override]
45
    public function getOfferAmount(): int
46
    {
47 1
        return $this->bodyParameter('amount')->int()->defaultsTo(0);
48
    }
49
}
50