ThemesProcessor.php 995 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @package Grav\Common\Processors
  4. *
  5. * @copyright Copyright (c) 2015 - 2023 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Common\Processors;
  9. use Psr\Http\Message\ResponseInterface;
  10. use Psr\Http\Message\ServerRequestInterface;
  11. use Psr\Http\Server\RequestHandlerInterface;
  12. /**
  13. * Class ThemesProcessor
  14. * @package Grav\Common\Processors
  15. */
  16. class ThemesProcessor extends ProcessorBase
  17. {
  18. /** @var string */
  19. public $id = 'themes';
  20. /** @var string */
  21. public $title = 'Themes';
  22. /**
  23. * @param ServerRequestInterface $request
  24. * @param RequestHandlerInterface $handler
  25. * @return ResponseInterface
  26. */
  27. public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
  28. {
  29. $this->startTimer();
  30. $this->container['themes']->init();
  31. $this->stopTimer();
  32. return $handler->handle($request);
  33. }
  34. }