mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 10:50:48 +00:00
25 lines
541 B
PHP
25 lines
541 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Rector\Parser;
|
|
|
|
use PhpParser\Lexer;
|
|
use PhpParser\Lexer\Emulative;
|
|
|
|
/**
|
|
* This Lexer allows Format-perserving AST Transformations
|
|
* @see https://github.com/nikic/PHP-Parser/issues/344#issuecomment-298162516
|
|
*/
|
|
final class LexerFactory
|
|
{
|
|
public function create(): Lexer
|
|
{
|
|
return new Emulative([
|
|
'usedAttributes' => [
|
|
'comments',
|
|
'startLine', 'endLine',
|
|
'startTokenPos', 'endTokenPos',
|
|
],
|
|
]);
|
|
}
|
|
}
|