Documentation

AbstractDefaultParametersMatcher extends AbstractContextAwareMatcher
in package

An abstract tab completion Matcher which implements ContextAware.

The AutoCompleter service will inject a Context instance into all ContextAware Matchers.

Table of Contents

CONSTANT_SYNTAX  = '^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$'
Syntax types
MISC_OPERATORS  = '+-*/^|&'
T_AND_EQUAL  = 'T_AND_EQUAL'
T_BOOLEAN_AND  = 'T_BOOLEAN_AND'
T_BOOLEAN_OR  = 'T_BOOLEAN_OR'
T_CLONE  = 'T_CLONE'
T_DOUBLE_COLON  = 'T_DOUBLE_COLON'
T_ENCAPSED_AND_WHITESPACE  = 'T_ENCAPSED_AND_WHITESPACE'
T_INCLUDE  = 'T_INCLUDE'
T_INCLUDE_ONCE  = 'T_INCLUDE_ONCE'
T_NEW  = 'T_NEW'
T_NS_SEPARATOR  = 'T_NS_SEPARATOR'
T_OBJECT_OPERATOR  = 'T_OBJECT_OPERATOR'
T_OPEN_TAG  = 'T_OPEN_TAG'
Token values
T_REQUIRE  = 'T_REQUIRE'
T_REQUIRE_ONCE  = 'T_REQUIRE_ONCE'
T_STRING  = 'T_STRING'
T_VARIABLE  = 'T_VARIABLE'
T_WHITESPACE  = 'T_WHITESPACE'
VAR_SYNTAX  = '^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$'
$context  : Context
Context instance (for ContextAware interface).
getDefaultParameterCompletion()  : array<string|int, mixed>
getMatches()  : array<string|int, mixed>
Provide tab completion matches for readline input.
hasMatched()  : bool
Check whether this matcher can provide completions for $tokens.
hasSyntax()  : bool
Check whether $token matches a given syntax pattern.
hasToken()  : bool
Check whether $token type is present in $coll.
isOperator()  : bool
Check whether $token is an operator.
needCompleteClass()  : mixed
setContext()  : mixed
ContextAware interface.
startsWith()  : bool
Check whether $word starts with $prefix.
tokenIs()  : bool
Check whether $token type is $which.
getInput()  : string
Get current readline input word.
getNamespaceAndClass()  : string
Get current namespace and class (if any) from readline input.
getVariable()  : mixed
Get a Context variable by name.
getVariables()  : array<string|int, mixed>
Get all variables in the current Context.
valueToShortString()  : string
Takes in the default value of a parameter and turns it into a string representation that fits inline.

Constants

CONSTANT_SYNTAX

Syntax types

public mixed CONSTANT_SYNTAX = '^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$'

T_ENCAPSED_AND_WHITESPACE

public mixed T_ENCAPSED_AND_WHITESPACE = 'T_ENCAPSED_AND_WHITESPACE'

T_OBJECT_OPERATOR

public mixed T_OBJECT_OPERATOR = 'T_OBJECT_OPERATOR'

VAR_SYNTAX

public mixed VAR_SYNTAX = '^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$'

Properties

Methods

getDefaultParameterCompletion()

public getDefaultParameterCompletion(array<string|int, ReflectionParameter$reflectionParameters) : array<string|int, mixed>
Parameters
$reflectionParameters : array<string|int, ReflectionParameter>
Return values
array<string|int, mixed>

getMatches()

Provide tab completion matches for readline input.

public abstract getMatches(array<string|int, mixed> $tokens[, array<string|int, mixed> $info = [] ]) : array<string|int, mixed>
Parameters
$tokens : array<string|int, mixed>

information substracted with get_token_all

$info : array<string|int, mixed> = []

readline_info object

Return values
array<string|int, mixed>

The matches resulting from the query

hasMatched()

Check whether this matcher can provide completions for $tokens.

public hasMatched(array<string|int, mixed> $tokens) : bool
Parameters
$tokens : array<string|int, mixed>

Tokenized readline input

Return values
bool

hasSyntax()

Check whether $token matches a given syntax pattern.

public static hasSyntax(mixed $token[, string $syntax = self::VAR_SYNTAX ]) : bool
Parameters
$token : mixed

A PHP token (see token_get_all)

$syntax : string = self::VAR_SYNTAX

A syntax pattern (default: variable pattern)

Return values
bool

hasToken()

Check whether $token type is present in $coll.

public static hasToken(array<string|int, mixed> $coll, mixed $token) : bool
Parameters
$coll : array<string|int, mixed>

A list of token types

$token : mixed

A PHP token (see token_get_all)

Return values
bool

isOperator()

Check whether $token is an operator.

public static isOperator(mixed $token) : bool
Parameters
$token : mixed

A PHP token (see token_get_all)

Return values
bool

needCompleteClass()

public static needCompleteClass(mixed $token) : mixed
Parameters
$token : mixed
Return values
mixed

startsWith()

Check whether $word starts with $prefix.

public static startsWith(string $prefix, string $word) : bool
Parameters
$prefix : string
$word : string
Return values
bool

tokenIs()

Check whether $token type is $which.

public static tokenIs(mixed $token, string $which) : bool
Parameters
$token : mixed

A PHP token (see token_get_all)

$which : string

A PHP token type

Return values
bool

getInput()

Get current readline input word.

protected getInput(array<string|int, mixed> $tokens) : string
Parameters
$tokens : array<string|int, mixed>

Tokenized readline input (see token_get_all)

Return values
string

getNamespaceAndClass()

Get current namespace and class (if any) from readline input.

protected getNamespaceAndClass(array<string|int, mixed> $tokens) : string
Parameters
$tokens : array<string|int, mixed>

Tokenized readline input (see token_get_all)

Return values
string

getVariable()

Get a Context variable by name.

protected getVariable(string $var) : mixed
Parameters
$var : string

Variable name

Return values
mixed

getVariables()

Get all variables in the current Context.

protected getVariables() : array<string|int, mixed>
Return values
array<string|int, mixed>

valueToShortString()

Takes in the default value of a parameter and turns it into a string representation that fits inline.

private valueToShortString(mixed $value) : string

This is not 100% true to the original (newlines are inlined, for example).

Parameters
$value : mixed
Return values
string

Search results