vendor/api-platform/core/src/Action/EntrypointAction.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the API Platform project.
  4.  *
  5.  * (c) Kévin Dunglas <dunglas@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace ApiPlatform\Core\Action;
  12. use ApiPlatform\Core\Api\Entrypoint;
  13. use ApiPlatform\Core\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
  14. /**
  15.  * Generates the API entrypoint.
  16.  *
  17.  * @author Kévin Dunglas <dunglas@gmail.com>
  18.  */
  19. final class EntrypointAction
  20. {
  21.     private $resourceNameCollectionFactory;
  22.     public function __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory)
  23.     {
  24.         $this->resourceNameCollectionFactory $resourceNameCollectionFactory;
  25.     }
  26.     public function __invoke(): Entrypoint
  27.     {
  28.         return new Entrypoint($this->resourceNameCollectionFactory->create());
  29.     }
  30. }