You are here

abstract class AbstractRequestProcessor in Monolog 8

Same name and namespace in other branches
  1. 2.x src/Logger/Processor/AbstractRequestProcessor.php \Drupal\monolog\Logger\Processor\AbstractRequestProcessor

Base class for all processors that needs access to request data.

Hierarchy

Expanded class hierarchy of AbstractRequestProcessor

File

src/Logger/Processor/AbstractRequestProcessor.php, line 10

Namespace

Drupal\monolog\Logger\Processor
View source
abstract class AbstractRequestProcessor {

  /**
   * @var \Symfony\Component\HttpFoundation\RequestStack
   */
  private $requestStack;

  /**
   * RequestProcessor constructor.
   *
   * @param \Symfony\Component\HttpFoundation\RequestStack
   */
  public function __construct(RequestStack $requestStack) {
    $this->requestStack = $requestStack;
  }

  /**
   * @return null|\Symfony\Component\HttpFoundation\Request
   */
  public function getRequest() {
    if ($this->requestStack && ($request = $this->requestStack
      ->getCurrentRequest())) {
      return $request;
    }
    return NULL;
  }

}

Members