20 if (!$this->getName()) {
24 $indent = $this->getIndentation();
26 if (($docBlock = $this->getDocBlock()) !==
null) {
27 $docBlock->setIndentation($indent);
28 $output .= $docBlock->generate();
33 $output .= $this->getVisibility() . (($this->isStatic()) ?
' static' :
'')
34 .
' function ' . $this->getName() .
'(';
36 $parameters = $this->getParameters();
37 if (!empty($parameters)) {
38 $parameterOutput = [];
39 foreach ($parameters as $parameter) {
40 $parameterOutput[] = $parameter->generate();
42 $output .= implode(
', ', $parameterOutput);
45 $output .=
');' . self::LINE_FEED;
58 if ($this->getVisibility() != self::VISIBILITY_PUBLIC) {
59 throw new \LogicException(
60 "Interface method visibility can only be 'public'. Method name: '{$this->getName()}'" 63 if ($this->isFinal()) {
64 throw new \LogicException(
65 "Interface method cannot be marked as 'final'. Method name: '{$this->getName()}'" 68 if ($this->isAbstract()) {
69 throw new \LogicException(
70 "'abstract' modifier cannot be used for interface method. Method name: '{$this->getName()}'"
validateMethodModifiers()