You are here

class ProfilerStorageManager in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Profiler/ProfilerStorageManager.php \Drupal\webprofiler\Profiler\ProfilerStorageManager
  2. 8.2 webprofiler/src/Profiler/ProfilerStorageManager.php \Drupal\webprofiler\Profiler\ProfilerStorageManager
  3. 4.x webprofiler/src/Profiler/ProfilerStorageManager.php \Drupal\webprofiler\Profiler\ProfilerStorageManager

Class ProfilerStorageManager

Hierarchy

Expanded class hierarchy of ProfilerStorageManager

2 files declare their use of ProfilerStorageManager
ConfigForm.php in webprofiler/src/Form/ConfigForm.php
DashboardController.php in webprofiler/src/Controller/DashboardController.php
1 string reference to 'ProfilerStorageManager'
webprofiler.services.yml in webprofiler/webprofiler.services.yml
webprofiler/webprofiler.services.yml
1 service uses ProfilerStorageManager
profiler.storage_manager in webprofiler/webprofiler.services.yml
Drupal\webprofiler\Profiler\ProfilerStorageManager

File

webprofiler/src/Profiler/ProfilerStorageManager.php, line 10

Namespace

Drupal\webprofiler\Profiler
View source
class ProfilerStorageManager {

  /**
   * @var array
   */
  private $storages;

  /**
   * @return array
   */
  public function getStorages() {
    $output = [];

    /** @var \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface $storage */
    foreach ($this->storages as $id => $storage) {
      $output[$id] = $storage['title'];
    }
    return $output;
  }

  /**
   * @param $id
   *
   * @return array
   */
  public function getStorage($id) {
    return $this->storages[$id];
  }

  /**
   * @param $id
   * @param $title
   * @param \Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface $storage
   */
  public function addStorage($id, $title, ProfilerStorageInterface $storage) {
    $this->storages[$id] = [
      'title' => $title,
      'class' => $storage,
    ];
  }

}

Members