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

Breadcrumb

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

function Dumper::getBlockIndentationIndicator

2 calls to Dumper::getBlockIndentationIndicator()
Dumper::dump in vendor/symfony/yaml/Dumper.php
Dumps a PHP value to YAML.
Dumper::dumpTaggedValue in vendor/symfony/yaml/Dumper.php

File

vendor/symfony/yaml/Dumper.php, line 159

Class

Dumper
Dumper dumps PHP variables to YAML strings.

Namespace

Symfony\Component\Yaml

Code

private function getBlockIndentationIndicator(string $value) : string {
    $lines = explode("\n", $value);
    // If the first line (that is neither empty nor contains only spaces)
    // starts with a space character, the spec requires a block indentation indicator
    // http://www.yaml.org/spec/1.2/spec.html#id2793979
    foreach ($lines as $line) {
        if ('' !== trim($line, ' ')) {
            return str_starts_with($line, ' ') ? (string) $this->indentation : '';
        }
    }
    return '';
}

API Navigation

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