Skip to content

Commit be1584b

Browse files
committed
adding check for array
1 parent 18de4bf commit be1584b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Naneau/Obfuscator/Node/Visitor/Scrambler.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@ public function setIgnore(array $ignore)
148148
**/
149149
public function addIgnore($ignore)
150150
{
151-
$this->ignore = array_merge($this->ignore, (array) $ignore);
152-
151+
if (is_string($ignore)) {
152+
$this->ignore = array_merge($this->ignore, array($ignore));
153+
} else if (is_array($ignore)) {
154+
$this->ignore = array_merge($this->ignore, $ignore);
155+
} else {
156+
throw new InvalidArgumentException('Invalid ignore type passed');
157+
}
153158
return $this;
154159
}
155160
}

0 commit comments

Comments
 (0)