You are here

public static function Inspector::assertAllStrings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Component/Assertion/Inspector.php \Drupal\Component\Assertion\Inspector::assertAllStrings()

Asserts that all members are strings.

Use this only if it is vital that the members not be objects, otherwise test with ::assertAllStringable().

Parameters

mixed $traversable: Variable to be examined.

Return value

bool TRUE if $traversable can be traversed and all members are strings.

1 call to Inspector::assertAllStrings()
InspectorTest::testAssertAllStrings in core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php
Tests asserting all members are strings.

File

core/lib/Drupal/Component/Assertion/Inspector.php, line 83
Contains \Drupal\Component\Assertion\Inspector.

Class

Inspector
Generic inspections for the assert() statement.

Namespace

Drupal\Component\Assertion

Code

public static function assertAllStrings($traversable) {
  return static::assertAll('is_string', $traversable);
}