Docs: Use PHP 7 return types (#405)

This commit is contained in:
Tomáš Votruba 2017-08-07 22:49:26 +02:00 committed by Nikita Popov
parent 94b5017e89
commit 770c314dd1

View File

@ -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