1 | <?php |
||
10 | class TranslationGroup |
||
11 | { |
||
12 | /** |
||
13 | * Translation ID |
||
14 | */ |
||
15 | private $id; |
||
16 | |||
17 | /** |
||
18 | * All translations for a specific key (Kunstmaan\TranslatorBundle\Model\Translation\Translation) |
||
19 | * |
||
20 | * @var Doctrine\Common\Collections\ArrayCollection |
||
21 | **/ |
||
22 | private $translations; |
||
23 | |||
24 | /** |
||
25 | * Translation identifier |
||
26 | * |
||
27 | * @var string |
||
28 | **/ |
||
29 | private $keyword; |
||
30 | |||
31 | /** |
||
32 | * The domain name of this group |
||
33 | * |
||
34 | **/ |
||
35 | private $domain; |
||
36 | |||
37 | 3 | public function __construct() |
|
41 | |||
42 | 3 | public function hasTranslation($locale) |
|
43 | { |
||
44 | 3 | if (count($this->translations) <= 0) { |
|
45 | 3 | return false; |
|
46 | } |
||
47 | |||
48 | 3 | if ($this->getTranslationByLocale($locale) !== null) { |
|
49 | 3 | return true; |
|
50 | } |
||
51 | |||
52 | 2 | return false; |
|
53 | } |
||
54 | |||
55 | 3 | public function getTranslationByLocale($locale) |
|
56 | { |
||
57 | 3 | if (count($this->translations) <= 0) { |
|
58 | return null; |
||
59 | } |
||
60 | |||
61 | 3 | foreach ($this->translations as $translation) { |
|
62 | 3 | if (strtolower($translation->getLocale()) == strtolower($locale)) { |
|
63 | 3 | return $translation; |
|
64 | } |
||
65 | } |
||
66 | |||
67 | 2 | return null; |
|
68 | } |
||
69 | |||
70 | public function getTranslationTextByLocale($locale) |
||
76 | |||
77 | public function addTranslation(Translation $translation) |
||
82 | |||
83 | public function getTranslations() |
||
87 | |||
88 | 3 | public function setTranslations($translations) |
|
95 | |||
96 | /** |
||
97 | * @param mixed $id |
||
98 | */ |
||
99 | 3 | public function setId($id) |
|
103 | |||
104 | /** |
||
105 | * @return mixed |
||
106 | */ |
||
107 | 3 | public function getId() |
|
111 | |||
112 | 3 | public function getKeyword() |
|
116 | |||
117 | 3 | public function setKeyword($keyword) |
|
121 | |||
122 | 3 | public function getDomain() |
|
126 | |||
127 | 3 | public function setDomain($domain) |
|
131 | } |
||
132 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..