Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PrettyPrinterAbstract.php

function PrettyPrinterAbstract::setIndentLevel

Set indentation level

Parameters

int $level Level in number of spaces:

3 calls to PrettyPrinterAbstract::setIndentLevel()
PrettyPrinterAbstract::outdent in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Decrease indentation level.
PrettyPrinterAbstract::p in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Pretty prints a node.
PrettyPrinterAbstract::pArray in vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
Perform a format-preserving pretty print of an array.

File

vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php, line 231

Class

PrettyPrinterAbstract

Namespace

PhpParser

Code

protected function setIndentLevel(int $level) : void {
    $this->indentLevel = $level;
    if ($this->useTabs) {
        $tabs = \intdiv($level, $this->tabWidth);
        $spaces = $level % $this->tabWidth;
        $this->nl = $this->newline . \str_repeat("\t", $tabs) . \str_repeat(' ', $spaces);
    }
    else {
        $this->nl = $this->newline . \str_repeat(' ', $level);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal