Issues (219)

Compiler/BeanstalkdCompilerPass.php (4 issues)

Labels
Severity
1
<?php
2
3
namespace Dtc\QueueBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
0 ignored issues
show
The type Symfony\Component\Depend...r\CompilerPassInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
0 ignored issues
show
The type Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Symfony\Component\DependencyInjection\Definition;
0 ignored issues
show
The type Symfony\Component\DependencyInjection\Definition was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\DependencyInjection\Reference;
0 ignored issues
show
The type Symfony\Component\DependencyInjection\Reference was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class BeanstalkdCompilerPass implements CompilerPassInterface
11
{
12 1
    public function process(ContainerBuilder $container)
13
    {
14 1
        if ($container->hasParameter('dtc_queue.beanstalkd.host') &&
15 1
            $container->getParameter('dtc_queue.beanstalkd.host')) {
16 1
            $definition = new Definition(
17 1
                'Pheanstalk\\Pheanstalk',
18
                [
19 1
                    new Definition(
20 1
                        'Pheanstalk\\Connection',
21
                        [
22 1
                            new Definition(
23 1
                                'Pheanstalk\\SocketFactory',
24 1
                                [$container->getParameter('dtc_queue.beanstalkd.host'), $container->getParameter('dtc_queue.beanstalkd.port')]
25
                            ),
26
                        ]
27
                    ),
28
                ]
29
            );
30 1
            $container->setDefinition('dtc_queue.beanstalkd', $definition);
31 1
            $definition = $container->getDefinition('dtc_queue.manager.job.beanstalkd');
32 1
            $definition->addMethodCall('setBeanstalkd', [new Reference('dtc_queue.beanstalkd')]);
33 1
            if ($container->hasParameter('dtc_queue.beanstalkd.tube')) {
34 1
                $definition->addMethodCall('setTube', [$container->getParameter('dtc_queue.beanstalkd.tube')]);
35
            }
36
        }
37 1
    }
38
}
39