Find an item by its name.

Parameters

string $name: The name to find.

Return value

DisplayInfoInterface|null The found item, or NULL if none is found.

File

phpunit_example/src/DisplayManager.php, line 66

Class

DisplayManager
An example class to demonstrate unit testing.

Namespace

Drupal\phpunit_example

Code

public function item($name) {
  if (isset($this->items[$name])) {
    return $this->items[$name];
  }
  return NULL;
}