Skip to content

Commit 1335284

Browse files
committed
minor #69 do not count on null (xabbuh)
This PR was merged into the 2.x branch. Discussion ---------- do not count on null Commits ------- 1d708d8 do not count on null
2 parents c444f9e + 1d708d8 commit 1335284

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Definition.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,6 @@ public function equals(Definition $definition)
211211
return false;
212212
}
213213

214-
if (count($this->name) !== count($definition->name)) {
215-
return false;
216-
}
217-
218-
if (count($this->description) !== count($definition->description)) {
219-
return false;
220-
}
221-
222214
if (null !== $this->name xor null !== $definition->name) {
223215
return false;
224216
}
@@ -228,6 +220,10 @@ public function equals(Definition $definition)
228220
}
229221

230222
if (null !== $this->name) {
223+
if (count($this->name) !== count($definition->name)) {
224+
return false;
225+
}
226+
231227
foreach ($this->name as $language => $value) {
232228
if (!isset($definition->name[$language])) {
233229
return false;
@@ -240,6 +236,10 @@ public function equals(Definition $definition)
240236
}
241237

242238
if (null !== $this->description) {
239+
if (count($this->description) !== count($definition->description)) {
240+
return false;
241+
}
242+
243243
foreach ($this->description as $language => $value) {
244244
if (!isset($definition->description[$language])) {
245245
return false;

0 commit comments

Comments
 (0)