vendor/pimcore/pimcore/lib/Controller/ArgumentValueResolver/WebsiteConfigValueResolver.php line 47

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Controller\ArgumentValueResolver;
  15. use Pimcore\Config;
  16. use Symfony\Component\HttpFoundation\Request;
  17. use Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface;
  18. use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
  19. /**
  20.  * @internal
  21.  */
  22. final class WebsiteConfigValueResolver implements ArgumentValueResolverInterface
  23. {
  24.     /**
  25.      * @param Request $request
  26.      * @param ArgumentMetadata $argument
  27.      *
  28.      * @return bool
  29.      */
  30.     public function supports(Request $requestArgumentMetadata $argument): bool
  31.     {
  32.         return $argument->getType() === Config\Config::class && $argument->getName() === 'websiteConfig';
  33.     }
  34.     /**
  35.      * @param Request $request
  36.      * @param ArgumentMetadata $argument
  37.      *
  38.      * @return iterable
  39.      */
  40.     public function resolve(Request $requestArgumentMetadata $argument): iterable
  41.     {
  42.         yield Config::getWebsiteConfig();
  43.     }
  44. }