PHP Class PhpSpec\CodeAnalysis\TokenizedTypeHintRewriter

Inheritance: implements PhpSpec\CodeAnalysis\TypeHintRewriter
Show file Open project: phpspec/phpspec

Public Methods

Method Description
__construct ( PhpSpec\Loader\Transformer\TypeHintIndex $typeHintIndex, PhpSpec\CodeAnalysis\NamespaceResolver $namespaceResolver )
rewrite ( string $classDefinition ) : string

Private Methods

Method Description
extractTypehints ( array &$tokens, integer $index, array $token )
isToken ( array | string $token, string $string ) : boolean
reset ( )
shouldExtractTokensOfClass ( string $className ) : boolean
stripTypeHints ( array $tokens ) : array
tokenHasType ( array | string $token, string $type ) : boolean
tokensToString ( array $tokens ) : string

Method Details

__construct() public method

public __construct ( PhpSpec\Loader\Transformer\TypeHintIndex $typeHintIndex, PhpSpec\CodeAnalysis\NamespaceResolver $namespaceResolver )
$typeHintIndex PhpSpec\Loader\Transformer\TypeHintIndex
$namespaceResolver PhpSpec\CodeAnalysis\NamespaceResolver

rewrite() public method

public rewrite ( string $classDefinition ) : string
$classDefinition string
return string