<?php


namespace AutoAdmin\Bundle\BrickBuilder\Request;


use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

class CustomRequestStack extends RequestStack
{
    const REQUEST_ATTR_NAME = '_brick_builder_cli_fake_request';

    public function __construct()
    {
        if (php_sapi_name() === 'cli') {
            $request = Request::create('/', 'GET');
            $request->attributes->set(self::REQUEST_ATTR_NAME, true);
            $this->push($request);
        }
    }
}