Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit da6920b

Browse files
committed
Merge branch 'fix/#34-method-name-cannot-be-optional'
Close #34
2 parents 6c9be80 + 12d1f17 commit da6920b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ All notable changes to this project will be documented in this file, in reverse
1818

1919
### Fixed
2020

21-
- Nothing.
21+
- [#34](https://github.com/zendframework/zend-code/pull/34) method name cannot be optional when adding a method
22+
to a class generator.
2223

2324
## 3.0.0 - 2016-01-13
2425

doc/book/generator/reference.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ class Zend\Code\Generator\ClassGenerator extends Zend\Code\Generator\AbstractGen
119119
public function getProperties()
120120
public function getProperty($propertyName)
121121
public function addMethods(Array $methods)
122-
public function addMethod($method)
122+
public function addMethod(
123+
$name,
124+
Array $parameters = [],
125+
$flags = Zend\Code\Generator\MethodGenerator::FLAG_PUBLIC,
126+
$body = null,
127+
$docBlock = null
128+
)
123129
public function getMethods()
124130
public function getMethod($methodName)
125131
public function hasMethod($methodName)

src/Generator/ClassGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ public function addMethods(array $methods)
719719
* @return ClassGenerator
720720
*/
721721
public function addMethod(
722-
$name = null,
722+
$name,
723723
array $parameters = [],
724724
$flags = MethodGenerator::FLAG_PUBLIC,
725725
$body = null,

0 commit comments

Comments
 (0)