CommonData::hasEID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Inspirum\Balikobot\Model\PackageData\Package;
6
7
use Inspirum\Balikobot\Definitions\Attribute;
8
use function implode;
9
10
trait CommonData
11
{
12 25
    public function setEID(string $id): void
13
    {
14 25
        $this->offsetSet(Attribute::EID, $id);
0 ignored issues
show
Bug introduced by
It seems like offsetSet() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        $this->/** @scrutinizer ignore-call */ 
15
               offsetSet(Attribute::EID, $id);
Loading history...
15
    }
16
17 5
    public function getEID(): ?string
18
    {
19 5
        return $this[Attribute::EID] ?? null;
20
    }
21
22 26
    public function hasEID(): bool
23
    {
24 26
        return $this->offsetExists(Attribute::EID);
0 ignored issues
show
Bug introduced by
It seems like offsetExists() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        return $this->/** @scrutinizer ignore-call */ offsetExists(Attribute::EID);
Loading history...
25
    }
26
27 1
    public function setOrderNumber(int $orderNumber): void
28
    {
29 1
        $this->offsetSet(Attribute::ORDER_NUMBER, $orderNumber);
30
    }
31
32 1
    public function setRealOrderId(string $realOrderId): void
33
    {
34 1
        $this->offsetSet(Attribute::REAL_ORDER_ID, $realOrderId);
35
    }
36
37 21
    public function setServiceType(string $serviceType): void
38
    {
39 21
        $this->offsetSet(Attribute::SERVICE_TYPE, $serviceType);
40
    }
41
42
    /**
43
     * @param list<string> $services
0 ignored issues
show
Bug introduced by
The type Inspirum\Balikobot\Model\PackageData\Package\list 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...
44
     */
45 1
    public function setServices(array $services): void
46
    {
47 1
        $this->offsetSet(Attribute::SERVICES, implode('+', $services));
48
    }
49
50 16
    public function setBranchId(string $branchId): void
51
    {
52 16
        $this->offsetSet(Attribute::BRANCH_ID, $branchId);
53
    }
54
55 1
    public function setBranchType(string $branchType): void
56
    {
57 1
        $this->offsetSet(Attribute::BRANCH_TYPE, $branchType);
58
    }
59
60 1
    public function setReturnFullErrors(bool $fullErrors = true): void
61
    {
62 1
        $this->offsetSet(Attribute::RETURN_FULL_ERRORS, (int) $fullErrors);
63
    }
64
65 1
    public function setReturnTrack(bool $returnTrack = true): void
66
    {
67 1
        $this->offsetSet(Attribute::RETURN_TRACK, (int) $returnTrack);
68
    }
69
70 1
    public function setReturnFinalCarrierId(bool $returnCarrierId = true): void
71
    {
72 1
        $this->offsetSet(Attribute::RETURN_FINAL_CARRIER_ID, (int) $returnCarrierId);
73
    }
74
75 1
    public function setReturnBarcode(bool $returnBarcode = true): void
76
    {
77 1
        $this->offsetSet(Attribute::RETURN_BARCODE, (int) $returnBarcode);
78
    }
79
}
80