function TokenStream::getIndent
1 call to TokenStream::getIndent()
- TokenStream::calcIndentMap in vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ TokenStream.php - Precalculate the indentation at every token position.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ Internal/ TokenStream.php, line 276
Class
- TokenStream
- Provides operations on token streams, for use by pretty printer.
Namespace
PhpParser\InternalCode
private function getIndent(string $ws, int $tabWidth) : int {
$spaces = \substr_count($ws, " ");
$tabs = \substr_count($ws, "\t");
assert(\strlen($ws) === $spaces + $tabs);
return $spaces + $tabs * $tabWidth;
}