/
MethodGenerator.php
36 lines (30 loc) · 936 Bytes
/
MethodGenerator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace ProxyManager\Generator;
use Zend\Code\Generator\MethodGenerator as ZendMethodGenerator;
use Zend\Code\Reflection\MethodReflection;
/**
* Method generator that fixes minor quirks in ZF2's method generator
*
* @author Marco Pivetta <ocramius@gmail.com>
* @license MIT
*
* Note: following overrides are just fixing some "lies" in the documented types in zend-code
*
* @method \Zend\Code\Generator\DocBlockGenerator|null getDocBlock()
* @method string|null getBody()
* @method string|null getSourceContent()
*/
class MethodGenerator extends ZendMethodGenerator
{
/**
* {@inheritDoc}
*/
public static function fromReflectionWithoutBodyAndDocBlock(MethodReflection $reflectionMethod) : self
{
/** @var self $method */
$method = parent::copyMethodSignature($reflectionMethod);
$method->setInterface(false);
return $method;
}
}