Class luya\admin\openapi\phpdoc\PhpDocMethod

Available since version3.3.1
Source Code

Php DOc Method

The @method phpdoc describer.

Property Details

Hide inherited properties

$definition protected property
protected array $definition null
$phpDocParser protected property

Method Details

Hide inherited methods

__construct() public method


public void __construct ( luya\admin\openapi\phpdoc\PhpDocParser $phpDocParser, array $definition )
$phpDocParser luya\admin\openapi\phpdoc\PhpDocParser
$definition array

                public function __construct(PhpDocParser $phpDocParser, array $definition)
    $this->phpDocParser = $phpDocParser;
    $this->definition = $definition;

getDescription() public method


public string getDescription ( )

                public function getDescription()
    return $this->definition[4] ?? '';

getMethodName() public method

Method Name

Returns only the method name without arguments, for example actionView($id) should return actionView

public string getMethodName ( )

                public function getMethodName()
    return isset($this->definition[2]) ? trim($this->definition[2]) : false;

getMethodParams() public method

Method Param Description

Returns the definition of the action inside the () params.

public string getMethodParams ( )

                public function getMethodParams()
    return isset($this->definition[3]) ? trim($this->definition[3]) : false;

getNormalizedMethodName() public method

Returns a readable name for an action

For example the action is actionFooBar it will return Foo Bar.

public void getNormalizedMethodName ( )

                public function getNormalizedMethodName()
    $methodName = StringHelper::replaceFirst('action', '', $this->getMethodName());
    return Inflector::camel2words($methodName);

getReturnType() public method


Returns a Type definition.

public luya\admin\openapi\phpdoc\PhpDocType getReturnType ( )

                public function getReturnType()
    return new PhpDocType($this->phpDocParser, $this->definition[1] ?? null);