Skip to content

Commit

Permalink
Add implementation only if set
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijastuden committed Nov 20, 2015
1 parent 77242cc commit 084d4b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,9 @@ public function &addTrait($interface = null, $implementation = null) {
$this->traits[$interface] = [];
}

$this->traits[$interface][] = $implementation;
if ($implementation) {
$this->traits[$interface][] = $implementation;
}
} else {
throw new InvalidArgumentException('Interface or implementation are required');
}
Expand Down

0 comments on commit 084d4b4

Please sign in to comment.