vendor/gos/web-socket-bundle/DependencyInjection/CompilerPass/LoopFactoryCompilerPass.php line 10

Open in your IDE?
  1. <?php
  2. namespace Gos\Bundle\WebSocketBundle\DependencyInjection\CompilerPass;
  3. use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. @trigger_error(
  6.     sprintf('The %s class is deprecated will be removed in 2.0.'LoopFactoryCompilerPass::class),
  7.     E_USER_DEPRECATED
  8. );
  9. /**
  10.  * @deprecated to be removed in 2.0.
  11.  */
  12. class LoopFactoryCompilerPass implements CompilerPassInterface
  13. {
  14.     /**
  15.      * @param ContainerBuilder $container
  16.      */
  17.     public function process(ContainerBuilder $container)
  18.     {
  19.         $definition $container->getDefinition('gos_web_socket.server.event_loop');
  20.         if (method_exists($definition'setFactory')) {
  21.             $definition->setFactory('React\EventLoop\Factory::create');
  22.         } else {
  23.             // SF < 2.6
  24.             $definition
  25.                 ->setFactoryClass('React\EventLoop\Factory')
  26.                 ->setFactoryMethod('create');
  27.         }
  28.     }
  29. }