You are here

class StorageFactory in XHProf 8

Provides storage factory.

Hierarchy

Expanded class hierarchy of StorageFactory

File

src/StorageFactory.php, line 11

Namespace

Drupal\xhprof
View source
class StorageFactory {

  /**
   * Return the configured storage service.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config
   *   The config factory.
   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
   *   The container
   *
   * @return \Drupal\xhprof\XHProfLib\Storage\StorageInterface
   *   The storage service.
   */
  public static final function getStorage(ConfigFactoryInterface $config, ContainerInterface $container) {
    $storage = $config
      ->get('xhprof.config')
      ->get('storage') ?: 'xhprof.file_storage';
    return $container
      ->get($storage);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StorageFactory::getStorage final public static function Return the configured storage service.