Completed
Push — develop ( 828596...7c60f3 )
by
unknown
16:15 queued 08:33
created

Skill::getComputerSkills()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 */
9
10
namespace Cv\Entity;
11
12
use Core\Entity\AbstractIdentifiableEntity;
13
use Core\Entity\Collection\ArrayCollection;
14
use Doctrine\Common\Collections\Collection;
15
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
16
17
/**
18
 * initial Skill class.
19
 *
20
 * @package Cv\Entity
21
 * @ODM\EmbeddedDocument
22
 */
23
class Skill extends AbstractIdentifiableEntity
24
{
25
    
26
    /**
27
     * @ODM\EmbedMany(targetDocument="NativeLanguage")
28
     * @var ArrayCollection
29
     */
30
    protected $nativeLanguages;
31
    /**
32
     *
33
     * @var ArrayCollection
34
     * @ODM\EmbedMany(targetDocument="Language")
35
     */
36
    protected $languageSkills;
37
    
38
    /**
39
     *
40
     * @var ArrayCollection
41
     * @ODM\EmbedMany(targetDocument="ComputerSkill")
42
     */
43
    protected $computerSkills;
44
45
    /**
46
     * @param $nativeLanguages
47
     * @return $this
48
     */
49
    public function setNativeLanguages(Collection $nativeLanguages)
50
    {
51
        $this->nativeLanguages = $nativeLanguages;
0 ignored issues
show
Documentation Bug introduced by
$nativeLanguages is of type object<Doctrine\Common\Collections\Collection>, but the property $nativeLanguages was declared to be of type object<Core\Entity\Collection\ArrayCollection>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
52
        return $this;
53
    }
54
55
    /**
56
     * @return ArrayCollection
57
     */
58
    public function getNativeLanguages()
59
    {
60
        if (!is_object($this->nativeLanguages)) {
61
            $this->nativeLanguages = new ArrayCollection();
62
        }
63
        return $this->nativeLanguages;
64
    }
65
66
    /**
67
     * @param $languageSkills
68
     * @return $this
69
     */
70
    public function setLanguageSkills(Collection $languageSkills)
71
    {
72
        $this->languageSkills = $languageSkills;
0 ignored issues
show
Documentation Bug introduced by
$languageSkills is of type object<Doctrine\Common\Collections\Collection>, but the property $languageSkills was declared to be of type object<Core\Entity\Collection\ArrayCollection>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
73
        return $this;
74
    }
75
76
    /**
77
     * @return ArrayCollection
78
     */
79
    public function getLanguageSkills()
80
    {
81
        if (!is_object($this->languageSkills)) {
82
            $this->languageSkills = new ArrayCollection();
83
        }
84
        return $this->languageSkills;
85
    }
86
87
    /**
88
     * @param $computerSkills
89
     * @return $this
90
     */
91
    public function setComputerSkills(Collection $computerSkills)
92
    {
93
        $this->computerSkills = $computerSkills;
0 ignored issues
show
Documentation Bug introduced by
$computerSkills is of type object<Doctrine\Common\Collections\Collection>, but the property $computerSkills was declared to be of type object<Core\Entity\Collection\ArrayCollection>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
94
        return $this;
95
    }
96
97
    /**
98
     * @return ArrayCollection
99
     */
100
    public function getComputerSkills()
101
    {
102
        if (!is_object($this->computerSkills)) {
103
            $this->computerSkills = new ArrayCollection();
104
        }
105
        return $this->computerSkills;
106
    }
107
}
108