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

Breadcrumb

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

function Inline::dumpArray

Dumps a PHP array to a YAML string.

Parameters

array $value The PHP array to dump:

int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string:

1 call to Inline::dumpArray()
Inline::dump in vendor/symfony/yaml/Inline.php
Dumps a given PHP variable to a YAML string.

File

vendor/symfony/yaml/Inline.php, line 221

Class

Inline
Inline implements a YAML parser/dumper for the YAML inline syntax.

Namespace

Symfony\Component\Yaml

Code

private static function dumpArray(array $value, int $flags) : string {
    // array
    if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
        $output = [];
        foreach ($value as $val) {
            $output[] = self::dump($val, $flags);
        }
        return \sprintf('[%s]', implode(', ', $output));
    }
    return self::dumpHashArray($value, $flags);
}

API Navigation

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