PHP Class PHPCD\PHPCD

Inheritance: implements Lvht\MsgpackRpc\Handler
Exibir arquivo Open project: phpvim/phpcd.vim

Public Methods

Method Description
__construct ( $root, Psr\Log\LoggerInterface $logger, $match_type = self::MATCH_HEAD )
functype ( $class_name, $name ) : [type1, Fetch the function or class method return value's type
getPseudoProperties ( ReflectionClass $reflection )
info ( $class_name, $pattern, $static_mode = 'both', $public_only = true ) Fetch the completion list.
location ( string $class_name, string $method_name = null ) : [path, Fetch function or class method's source file path and their defination line number.
nsuse ( string $path ) : [ Fetch the php script's namespace and imports(by use) list.
proptype ( $class_name, $name ) : [type1, Fetch class attribute's type by @var annotation
psr4ns ( $path ) generate psr4 namespace according composer.json and file path
setMatchType ( string $matchType ) Set type of matching
setServer ( Lvht\MsgpackRpc\Server $server )

Private Methods

Method Description
arrayUnique ( $array )
classInfo ( $class_name, $pattern, $is_static, $public_only )
clearDoc ( $doc )
doc ( string $class_name, string $name, $is_method = true ) Fetch function, class method or class attribute's docblock
fixRelativeType ( $path, $names )
functionOrConstantInfo ( $pattern )
getConstPath ( $const_name, ReflectionClass $reflection )
getConstantsInfo ( $pattern )
getFunctionInfo ( $name, $pattern = null )
getMethodInfo ( $method, $pattern = null )
getModifierSymbols ( ) : array
getModifiers ( $reflection )
getPropertyInfo ( $property, $pattern )
matchPattern ( $pattern, $fullString ) : boolean
translateStaticMode ( string $mode ) : boolean | null
trim ( $str )
typeByDoc ( $path, $doc, $class_name )
typeByPropertyRead ( $doc, $path, $name )
typeByReturnType ( $class_name, $name )

Method Details

__construct() public method

public __construct ( $root, Psr\Log\LoggerInterface $logger, $match_type = self::MATCH_HEAD )
$logger Psr\Log\LoggerInterface

functype() public method

For PHP7 or newer version, it tries to use the return type gramar to fetch the real return type. For PHP5, it use the docblock's return or var annotation to fetch the type.
public functype ( $class_name, $name ) : [type1,
return [type1,

getPseudoProperties() public method

public getPseudoProperties ( ReflectionClass $reflection )
$reflection ReflectionClass

info() public method

If both $class_name and $pattern are setted, it will list the class's methods, constants, and properties, filted by pattern. If only $pattern is setted, it will list all the defined function (including the PHP's builtin function', filted by pattern.
public info ( $class_name, $pattern, $static_mode = 'both', $public_only = true )

location() public method

Fetch function or class method's source file path and their defination line number.
public location ( string $class_name, string $method_name = null ) : [path,
$class_name string class name
$method_name string method or function name
return [path,

nsuse() public method

Fetch the php script's namespace and imports(by use) list.
public nsuse ( string $path ) : [
$path string the php scrpit path
return [

proptype() public method

Fetch class attribute's type by @var annotation
public proptype ( $class_name, $name ) : [type1,
return [type1,

psr4ns() public method

generate psr4 namespace according composer.json and file path
public psr4ns ( $path )

setMatchType() public method

Set type of matching
public setMatchType ( string $matchType )
$matchType string

setServer() public method

public setServer ( Lvht\MsgpackRpc\Server $server )
$server Lvht\MsgpackRpc\Server