You are here

public static function YamlDefinitionsLoader::getInstance in Hook Event Dispatcher 8

Singleton get instance function.

Only need to load the files once from the filesystem.

Return value

\Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers\YamlDefinitionsLoader Existing or new YamlDefinitionsLoader instance.

2 calls to YamlDefinitionsLoader::getInstance()
EntityEventTest::setUp in tests/src/Unit/Preprocess/EntityEventTest.php
OtherEventTest::setUp in tests/src/Unit/Preprocess/OtherEventTest.php

File

tests/src/Unit/Preprocess/Helpers/YamlDefinitionsLoader.php, line 88

Class

YamlDefinitionsLoader
Class YamlDefinitionsLoader.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Preprocess\Helpers

Code

public static function getInstance() {
  if (static::$instance === NULL) {
    static::$instance = new static();
  }
  return static::$instance;
}