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

  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\Action;
  12. use ApiPlatform\Api\Entrypoint;
  13. use ApiPlatform\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.     public function __construct(private readonly ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory)
  22.     {
  23.     }
  24.     public function __invoke(): Entrypoint
  25.     {
  26.         return new Entrypoint($this->resourceNameCollectionFactory->create());
  27.     }
  28. }