You are here

protected function RequestTest::isAssocArray in OpenAPI 8

Determine if an array is associative array.

Parameters

array $arr: The array.

Return value

bool TRUE if the array is associative, otherwise false.

1 call to RequestTest::isAssocArray()
RequestTest::nestedKsort in tests/src/Functional/RequestTest.php
Sorts a nested array with ksort().

File

tests/src/Functional/RequestTest.php, line 509

Class

RequestTest
Tests requests OpenAPI routes.

Namespace

Drupal\Tests\openapi\Functional

Code

protected function isAssocArray(array $arr) {
  if (empty($arr)) {
    return FALSE;
  }
  return array_keys($arr) !== range(0, count($arr) - 1);
}