Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add removeMethod method

  • Loading branch information...
commit 1ee254c88e50ca170212559d4a00422e243b2d95 1 parent 38fe572
@neeckeloo authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.