Skip to content

Commit

Permalink
Add fluent interface to InjectionMethod
Browse files Browse the repository at this point in the history
- Altered setName() and addParameter() to "return $this" to allow
  chaining
  • Loading branch information
weierophinney committed Jun 13, 2011
1 parent 26f031b commit 91fd86c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/Zend/Di/Definition/Builder/InjectionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class InjectionMethod
public function setName($name)
{
$this->name = $name;
return $this;
}

public function getName()
Expand All @@ -26,6 +27,7 @@ public function addParameter($name, $class = null, $position = self::PARAMETER_P
} else {
throw new \Exception('Implementation for parameter placement is incomplete');
}
return $this;
}

public function getParameters()
Expand Down

0 comments on commit 91fd86c

Please sign in to comment.