zendframework / zend-code

BSD 3-Clause "New" or "Revised" License
1.68k stars 79 forks source link

Add MethodGenerator::copyMethodSignature without body and phpdoc #132

Closed Tobion closed 6 years ago

Tobion commented 6 years ago

Adds a Zend\Code\Generator\MethodGenerator::copyMethodSignature method that is similar to fromReflection() but without the copying the method body and phpdoc as this is quite heavy to parse (it requires file IO, regexes, tokenization of code). It's for example useful when creating proxies where you normally change the method body afterwards anyway. See https://github.com/Ocramius/ProxyManager/pull/393 where it increases performance.

Tobion commented 6 years ago

@Ocramius can you merge this and make a release so I can use it in Ocramius/ProxyManager#393 ?

Ocramius commented 6 years ago

@Tobion I'll try to do releases over the weekend.