use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(MyService::class); $definition->setPublic(true);
use Symfony\Component\DependencyInjection\ContainerInterface; /** @var ContainerInterface $container */ $myService = $container->get('MyService');In this example, we retrieve a public service called “MyService” from the container using the `get()` method of the ContainerInterface. The Symfony\Component\DependencyInjection\Definition class is part of the Symfony Dependency Injection Component, which is a package library for managing dependencies and services in PHP applications.