You are here

public static function Inline::isHash in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/symfony/yaml/Inline.php \Symfony\Component\Yaml\Inline::isHash()

Check if given array is hash or just normal indexed array.

@internal

Parameters

array $value The PHP array to check:

Return value

bool true if value is hash array, false otherwise

3 calls to Inline::isHash()
Dumper::dump in vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php
Dumps a PHP value to YAML.
Inline::dumpArray in vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php
Dumps a PHP array to a YAML string.
InlineTest::testIsHash in vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php
@dataProvider getDataForIsHash

File

vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php, line 157

Class

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

Namespace

Symfony\Component\Yaml

Code

public static function isHash(array $value) {
  $expectedKey = 0;
  foreach ($value as $key => $val) {
    if ($key !== $expectedKey++) {
      return true;
    }
  }
  return false;
}