Twig_LexerInterface

Extends

Interface implemented by lexer classes.

author

Fabien Potencier fabien@symfony.com

deprecated

since 1.12 (to be removed in 3.0)

package

Default

Methods

Tokenizes a source code.

tokenize(string|\Twig\Source $code,string $name = null): \Twig\TokenStream
Throws
\Twig\Error\SyntaxError

When the code is syntactically wrong

Arguments

$code

string|\Twig\Source

The source code

$name

string

A unique identifier for the source code

Response

\Twig\TokenStream