1 | <?php |
||
39 | class PhpFunction extends AbstractModel implements GenerateableInterface, NamespaceInterface, DocblockInterface, RoutineInterface { |
||
40 | |||
41 | use BodyPart; |
||
42 | use DocblockPart; |
||
43 | use LongDescriptionPart; |
||
44 | use ParametersPart; |
||
45 | use QualifiedNamePart; |
||
46 | use ReferenceReturnPart; |
||
47 | use TypeDocblockGeneratorPart; |
||
48 | use TypePart; |
||
49 | |||
50 | // /** |
||
51 | // * Creates a PHP function from reflection |
||
52 | // * |
||
53 | // * @deprecated will be removed in version 0.5 |
||
54 | // * @param \ReflectionFunction $ref |
||
55 | // * @return PhpFunction |
||
56 | // */ |
||
57 | // public static function fromReflection(\ReflectionFunction $ref) { |
||
58 | // $function = self::create($ref->name) |
||
59 | // ->setReferenceReturned($ref->returnsReference()) |
||
60 | // ->setBody(ReflectionUtils::getFunctionBody($ref)); |
||
61 | |||
62 | // $docblock = new Docblock($ref); |
||
63 | // $function->setDocblock($docblock); |
||
64 | // $function->setDescription($docblock->getShortDescription()); |
||
65 | // $function->setLongDescription($docblock->getLongDescription()); |
||
66 | |||
67 | // foreach ($ref->getParameters() as $refParam) { |
||
68 | // assert($refParam instanceof \ReflectionParameter); // hmm - assert here? |
||
69 | |||
70 | // $param = PhpParameter::fromReflection($refParam); |
||
71 | // $function->addParameter($param); |
||
72 | // } |
||
73 | |||
74 | // return $function; |
||
75 | // } |
||
76 | |||
77 | /** |
||
78 | * Creates a new PHP function |
||
79 | * |
||
80 | * @param string $name qualified name |
||
81 | * @return static |
||
82 | */ |
||
83 | 6 | public static function create($name = null) { |
|
86 | |||
87 | /** |
||
88 | * Creates a new PHP function |
||
89 | * |
||
90 | * @param string $name qualified name |
||
91 | */ |
||
92 | 9 | public function __construct($name = null) { |
|
97 | |||
98 | /** |
||
99 | * @inheritDoc |
||
100 | */ |
||
101 | 3 | public function generateDocblock(): void { |
|
112 | } |
||
113 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.