class ExceptionDataCollector in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php \Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector
ExceptionDataCollector.
@author Fabien Potencier <fabien@symfony.com>
Hierarchy
- class \Symfony\Component\HttpKernel\DataCollector\DataCollector implements \Symfony\Component\HttpKernel\DataCollector\Serializable, DataCollectorInterface- class \Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector
 
Expanded class hierarchy of ExceptionDataCollector
1 file declares its use of ExceptionDataCollector
- ExceptionDataCollectorTest.php in vendor/symfony/ http-kernel/ Tests/ DataCollector/ ExceptionDataCollectorTest.php 
File
- vendor/symfony/ http-kernel/ DataCollector/ ExceptionDataCollector.php, line 23 
Namespace
Symfony\Component\HttpKernel\DataCollectorView source
class ExceptionDataCollector extends DataCollector {
  /**
   * {@inheritdoc}
   */
  public function collect(Request $request, Response $response, \Exception $exception = null) {
    if (null !== $exception) {
      $this->data = array(
        'exception' => FlattenException::create($exception),
      );
    }
  }
  /**
   * Checks if the exception is not null.
   *
   * @return bool true if the exception is not null, false otherwise
   */
  public function hasException() {
    return isset($this->data['exception']);
  }
  /**
   * Gets the exception.
   *
   * @return \Exception The exception
   */
  public function getException() {
    return $this->data['exception'];
  }
  /**
   * Gets the exception message.
   *
   * @return string The exception message
   */
  public function getMessage() {
    return $this->data['exception']
      ->getMessage();
  }
  /**
   * Gets the exception code.
   *
   * @return int The exception code
   */
  public function getCode() {
    return $this->data['exception']
      ->getCode();
  }
  /**
   * Gets the status code.
   *
   * @return int The status code
   */
  public function getStatusCode() {
    return $this->data['exception']
      ->getStatusCode();
  }
  /**
   * Gets the exception trace.
   *
   * @return array The exception trace
   */
  public function getTrace() {
    return $this->data['exception']
      ->getTrace();
  }
  /**
   * {@inheritdoc}
   */
  public function getName() {
    return 'exception';
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| DataCollector:: | protected | property | ||
| DataCollector:: | private | property | ||
| DataCollector:: | public | function | 1 | |
| DataCollector:: | public | function | 1 | |
| DataCollector:: | protected | function | Converts a PHP variable to a string. | |
| ExceptionDataCollector:: | public | function | Collects data for the given Request and Response. Overrides DataCollectorInterface:: | |
| ExceptionDataCollector:: | public | function | Gets the exception code. | |
| ExceptionDataCollector:: | public | function | Gets the exception. | |
| ExceptionDataCollector:: | public | function | Gets the exception message. | |
| ExceptionDataCollector:: | public | function | Returns the name of the collector. Overrides DataCollectorInterface:: | |
| ExceptionDataCollector:: | public | function | Gets the status code. | |
| ExceptionDataCollector:: | public | function | Gets the exception trace. | |
| ExceptionDataCollector:: | public | function | Checks if the exception is not null. | 
