<?php

namespace Khofmann\Request;

use Pecee\Http\Request as PRequest;
use Pecee\SimpleRouter\SimpleRouter;

class Request
{
  private function __construct()
  {
  }

  public static function request(): PRequest
  {
    return SimpleRouter::request();
  }

  public static function header(string $name, $defaultValue = null, bool $tryParse = true): ?string
  {
    return Request::request()->getHeader($name, $defaultValue, $tryParse);
  }

  public static function token()
  {
    return Request::header("token");
  }
}
