PimEEBatchJobs   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 13 2
1
<?php
2
3
namespace Actualys\Bundle\DrupalCommerceConnectorBundle\DependencyInjection\Compiler;
4
5
use Akeneo\Bundle\BatchBundle\DependencyInjection\Compiler\RegisterJobsPass;
6
use Symfony\Component\Config\Resource\FileResource;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
/**
10
 * Registers PIM EE batch jobs if the EE is installed
11
 *
12
 * @author Antoine Guigan <[email protected]>
13
 */
14
class PimEEBatchJobs extends RegisterJobsPass
15
{
16
    public function process(ContainerBuilder $container)
17
    {
18
        if (in_array(
19
            'PimEnterprise\Bundle\CatalogBundle\PimEnterpriseCatalogBundle',
20
            $container->getParameter('kernel.bundles'))
21
        ) {
22
            $registry = $container->getDefinition('akeneo_batch.connectors');
23
            $configFile = realpath(__DIR__ . '/../../Resources/config/pimee_batch_jobs.yml');
24
            $container->addResource(new FileResource($configFile));
25
26
            $this->registerJobs($registry, $configFile);
27
        }
28
    }
29
}