From 770c314dd12b1e563fef9b129ecf2aee2c51ae00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Mon, 7 Aug 2017 22:49:26 +0200 Subject: [PATCH] Docs: Use PHP 7 return types (#405) --- doc/component/Lexer.markdown | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/component/Lexer.markdown b/doc/component/Lexer.markdown index b22942d..b0913b5 100644 --- a/doc/component/Lexer.markdown +++ b/doc/component/Lexer.markdown @@ -95,10 +95,12 @@ Lexer extension A lexer has to define the following public interface: - void startLexing(string $code, ErrorHandler $errorHandler = null); - array getTokens(); - string handleHaltCompiler(); - int getNextToken(string &$value = null, array &$startAttributes = null, array &$endAttributes = null); +```php +function startLexing(string $code, ErrorHandler $errorHandler = null): void; +function getTokens(): array; +function handleHaltCompiler(): string; +function getNextToken(string &$value = null, array &$startAttributes = null, array &$endAttributes = null): int; +``` The `startLexing()` method is invoked with the source code that is to be lexed (including the opening tag) whenever the `parse()` method of the parser is called. It can be used to reset state or preprocess the source code or tokens. The