PHP Class Dunglas\PhpDocToTypeHint\Converter

Author: Kévin Dunglas ([email protected])
显示文件 Open project: dunglas/phpdoc-to-typehint Class Usage Examples

Public Methods

Method Description
convert ( phpDocumentor\Reflection\Php\Project $project, phpDocumentor\Reflection\Php\File $file ) : string Converts the given file.

Private Methods

Method Description
endsInNewLine ( string $output ) : string Determines if the string ends in a new line and returns it.
getDocBlock ( phpDocumentor\Reflection\Php\Project $project, integer $objectType, string $namespace = null, string $object = null, string $function ) : DocBlock | null Gets a DocBlock.
getDocBlockForFunction ( array $functions, string $function ) : DocBlock | null Gets the DocBlock of a function.
getDocBlockForInterfaces ( phpDocumentor\Reflection\Php\Project $project, array $fqsens, string $function ) : DocBlock | null Gets a DocBlock from an array of interfaces FQSEN instances.
getNamespace ( phpDocumentor\Reflection\Fqsen $fqsen ) : string Extracts a namespace from a FQSEN.
getObject ( phpDocumentor\Reflection\Php\Project $project, phpDocumentor\Reflection\Fqsen $fqsen, integer $objectType ) : phpDocumentor\Reflection\Php\Class_ | phpDocumentor\Reflection\Php\Interface_ | null Finds a Class_ or an Interface_ instance using its FQSEN.
getParameter ( phpDocumentor\Reflection\Php\Project $project, integer $objectType, string $namespace = null, string $object = null, string $function, string $parameter ) : array Gets the type and nullability of the parameter of a function.
getReturn ( phpDocumentor\Reflection\Php\Project $project, integer $objectType, string $namespace = null, string $object = null, string $function ) : array Gets the return type of a function.
getType ( Tag $tag ) : array Gets the parameter type and tries to find best-matching PHP type
getTypeFromTag ( Tag $tag ) : array Gets the type of the parameter or an empty array if it is not defined.
normalizeType ( string $docType ) : string Normalizes the type.

Method Details

convert() public method

Converts the given file.
public convert ( phpDocumentor\Reflection\Php\Project $project, phpDocumentor\Reflection\Php\File $file ) : string
$project phpDocumentor\Reflection\Php\Project
$file phpDocumentor\Reflection\Php\File
return string