Skip to content

Commit ecde729

Browse files
committed
Fix codacy's complaint
Signed-off-by: Jack Cherng <[email protected]>
1 parent 5efa215 commit ecde729

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Utility/Language.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ public function setLanguageOrTranslations($target): self
3939
{
4040
if (\is_string($target)) {
4141
$this->setUpWithLanguage($target);
42-
} elseif (\is_array($target)) {
42+
43+
return $this;
44+
}
45+
46+
if (\is_array($target)) {
4347
$this->setUpWithTranslations($target);
44-
} else {
45-
throw new \InvalidArgumentException('$target must be the type of string|string[]');
48+
49+
return $this;
4650
}
4751

48-
return $this;
52+
throw new \InvalidArgumentException('$target must be the type of string|string[]');
4953
}
5054

5155
/**

0 commit comments

Comments
 (0)