I am keep getting this error with my code although I only followed their instructions.
<?php
namespace Training\Test\App;
class FrontController extends \Magento\Framework\App\FrontController
{
protected $routerList;
protected $response;
protected $logger;
public function __construct(
\Magento\Framework\App\RouterList $routerList,
\Magento\Framework\App\Response\Http $response,
\Psr\Log\LoggerInterface $logger)
{
$this->routerList = $routerList;
$this->response = $response;
$this->logger = $logger;
}
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
foreach($this->routerList as $router)
{
$this->logger->addDebug(get_class($router));
}
return parent::dispatch($request);
}
}