You are here

abstract class DataCollector in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/DataCollector/DataCollector.php \Symfony\Component\HttpKernel\DataCollector\DataCollector

DataCollector.

Children of this class must store the collected data in the data property.

@author Fabien Potencier <fabien@symfony.com> @author Bernhard Schussek <bschussek@symfony.com>

Hierarchy

Expanded class hierarchy of DataCollector

2 files declare their use of DataCollector
MongoDbProfilerStorageTest.php in vendor/symfony/http-kernel/Tests/Profiler/MongoDbProfilerStorageTest.php
TranslationDataCollector.php in vendor/symfony/translation/DataCollector/TranslationDataCollector.php

File

vendor/symfony/http-kernel/DataCollector/DataCollector.php, line 24

Namespace

Symfony\Component\HttpKernel\DataCollector
View source
abstract class DataCollector implements DataCollectorInterface, \Serializable {
  protected $data = array();

  /**
   * @var ValueExporter
   */
  private $valueExporter;
  public function serialize() {
    return serialize($this->data);
  }
  public function unserialize($data) {
    $this->data = unserialize($data);
  }

  /**
   * Converts a PHP variable to a string.
   *
   * @param mixed $var A PHP variable
   *
   * @return string The string representation of the variable
   */
  protected function varToString($var) {
    if (null === $this->valueExporter) {
      $this->valueExporter = new ValueExporter();
    }
    return $this->valueExporter
      ->exportValue($var);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DataCollector::$data protected property
DataCollector::$valueExporter private property
DataCollector::serialize public function 1
DataCollector::unserialize public function 1
DataCollector::varToString protected function Converts a PHP variable to a string.
DataCollectorInterface::collect public function Collects data for the given Request and Response. 11
DataCollectorInterface::getName public function Returns the name of the collector. 11