Skip to content

Commit 277b0ad

Browse files
committed
fixes
1 parent d298796 commit 277b0ad

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ public function getExtends()
291291
*/
292292
public function addExtend($type)
293293
{
294+
$this->extends = (array) $this->extends;
294295
$this->extends[] = (string) $type;
295296
return $this;
296297
}
@@ -428,7 +429,7 @@ public function setProperties(array $props)
428429
{
429430
foreach ($props as $v) {
430431
if (!$v instanceof Property) {
431-
throw new Exception('Argument must be Nette\PhpGenerator\Property[].');
432+
throw new Nette\InvalidArgumentException('Argument must be Nette\PhpGenerator\Property[].');
432433
}
433434
}
434435
$this->properties = $props;
@@ -465,7 +466,7 @@ public function setMethods(array $methods)
465466
{
466467
foreach ($methods as $v) {
467468
if (!$v instanceof Method) {
468-
throw new Exception('Argument must be Nette\PhpGenerator\Method[].');
469+
throw new Nette\InvalidArgumentException('Argument must be Nette\PhpGenerator\Method[].');
469470
}
470471
}
471472
$this->methods = $methods;

src/PhpGenerator/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function setParameters(array $val)
142142
{
143143
foreach ($val as $v) {
144144
if (!$v instanceof Parameter) {
145-
throw new Exception('Argument must be Nette\PhpGenerator\Parameter[].');
145+
throw new Nette\InvalidArgumentException('Argument must be Nette\PhpGenerator\Parameter[].');
146146
}
147147
}
148148
$this->parameters = $val;

0 commit comments

Comments
 (0)