Submissions   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubmissions() 0 3 1
A addSubmission() 0 7 2
A removeSubmission() 0 7 2
1
<?php
2
3
namespace App\Entity\Attribute\Accessor;
4
5
use App\Entity\Submission;
6
7
/**
8
 * Trait Submissions
9
 */
10
trait Submissions
11
{
12
    /**
13
     * Add submission
14
     *
15
     * @param \App\Entity\Submission $submission
16
     * @return object
17
     */
18
    public function addSubmission(Submission $submission)
19
    {
20
        if (!$this->submissions->contains($submission)) {
21
            $this->submissions->add($submission);
22
        }
23
24
        return $this;
25
    }
26
27
    /**
28
     * Remove submission
29
     *
30
     * @param \App\Entity\Submission $submission
31
     * @return object
32
     */
33
    public function removeSubmission(Submission $submission)
34
    {
35
        if ($this->submissions->contains($submission)) {
36
            $this->submissions->removeElement($submission);
37
        }
38
39
        return $this;
40
    }
41
42
    /**
43
     * Get submissions
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 getSubmissions()
48
    {
49
        return $this->submissions;
50
    }
51
}
52