Statuses   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 8
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A removeStatus() 0 7 2
A getStatuses() 0 3 1
A addStatus() 0 7 2
1
<?php
2
3
namespace App\Entity\Attribute\Accessor;
4
5
use App\Entity\CaseStatus;
6
7
/**
8
 * Trait Statuses
9
 */
10
trait Statuses
11
{
12
    /**
13
     * Add status
14
     *
15
     * @param \App\Entity\CaseStatus $status
16
     * @return \App\Entity\CaseEntity
17
     */
18
    public function addStatus(CaseStatus $status)
19
    {
20
        if (!$this->statuses->contains($status)) {
21
            $this->statuses->add($status);
22
        }
23
24
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type App\Entity\Attribute\Accessor\Statuses which is incompatible with the documented return type App\Entity\CaseEntity.
Loading history...
25
    }
26
27
    /**
28
     * Remove status
29
     *
30
     * @param \App\Entity\CaseStatus $status
31
     * @return \App\Entity\CaseEntity
32
     */
33
    public function removeStatus(CaseStatus $status)
34
    {
35
        if ($this->statuses->contains($status)) {
36
            $this->statuses->removeElement($status);
37
        }
38
39
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type App\Entity\Attribute\Accessor\Statuses which is incompatible with the documented return type App\Entity\CaseEntity.
Loading history...
40
    }
41
42
    /**
43
     * Get statuses
44
     *
45
     * @return \Doctrine\Common\Collections\ArrayCollection
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection 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...
46
     */
47
    public function getStatuses()
48
    {
49
        return $this->statuses;
50
    }
51
}
52