Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Lexer\FunctionTokenizer::tokenize PHP Method

tokenize() public method

public tokenize ( string $value ) : string
$value string
return string
    public function tokenize(string $value) : string
    {
        $tokens = $this->tokenizer->tokenize($value);
        $tree = $this->buildTree($value, $tokens);
        $tokenizedValue = '';
        foreach ($tree as $node) {
            $tokenizedValue .= $this->tokenizer->isOpeningToken($node) ? sprintf('<aliceTokenizedFunction(%s)>', $node) : $node;
        }
        return $tokenizedValue;
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  *
  * @throws MalformedFunctionException
  */
 public function lex(string $value) : array
 {
     if (false === $this->functionTokenizer->isTokenized($value)) {
         $value = $this->functionTokenizer->tokenize($value);
     }
     return $this->decoratedLexer->lex($value);
 }
All Usage Examples Of Nelmio\Alice\FixtureBuilder\ExpressionLanguage\Lexer\FunctionTokenizer::tokenize