Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
37.50% covered (danger)
37.50%
3 / 8
37.50% covered (danger)
37.50%
3 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
HasStockStatus
37.50% covered (danger)
37.50%
3 / 8
37.50% covered (danger)
37.50%
3 / 8
23.62
0.00% covered (danger)
0.00%
0 / 1
 isPending
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isStarted
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isConcluded
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isSyncing
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isSyncFail
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 isWaiting
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isSeparated
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isReleasedForBilling
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Domain\StockIO\Traits;
4
5use Domain\StockIO\Enums\StockStatusEnum;
6
7trait HasStockStatus
8{
9    public function isPending(): bool
10    {
11        return $this->getAttribute('status') == StockStatusEnum::PENDING;
12    }
13
14    public function isStarted(): bool
15    {
16        return $this->getAttribute('status') == StockStatusEnum::STARTED;
17    }
18
19    public function isConcluded(): bool
20    {
21        return $this->getAttribute('status') == StockStatusEnum::CONCLUDED;
22    }
23
24    public function isSyncing(): bool
25    {
26        return $this->getAttribute('status') == StockStatusEnum::SYNCING;
27    }
28
29    public function isSyncFail(): bool
30    {
31        return $this->getAttribute('status') == StockStatusEnum::SYNC_FAIL;
32    }
33
34    public function isWaiting(): bool
35    {
36        return $this->getAttribute('status') == StockStatusEnum::WAITING;
37    }
38
39    public function isSeparated(): bool
40    {
41        return $this->getAttribute('status') == StockStatusEnum::SEPARATED;
42    }
43
44    public function isReleasedForBilling(): bool
45    {
46        return $this->getAttribute('status') == StockStatusEnum::RELEASED_FOR_BILLING;
47    }
48}