Skip to content
Browse files

Add removeMethod method

  • Loading branch information...
1 parent 38fe572 commit 1ee254c88e50ca170212559d4a00422e243b2d95 @neeckeloo committed
Showing with 17 additions and 1 deletion.
  1. +17 −1 library/Zend/Code/Generator/ClassGenerator.php
View
18 library/Zend/Code/Generator/ClassGenerator.php
@@ -621,7 +621,7 @@ public function getMethods()
*/
public function getMethod($methodName)
{
- foreach ($this->getMethods() as $method) {
+ foreach ($this->methods as $method) {
if ($method->getName() == $methodName) {
return $method;
}
@@ -632,6 +632,22 @@ public function getMethod($methodName)
/**
* @param string $methodName
+ * @return ClassGenerator
+ */
+ public function removeMethod($methodName)
+ {
+ foreach ($this->methods as $key => $method) {
+ if ($method->getName() == $methodName) {
+ unset($this->methods[$key]);
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param string $methodName
* @return bool
*/
public function hasMethod($methodName)

0 comments on commit 1ee254c

Please sign in to comment.
Something went wrong with that request. Please try again.