PimEEBatchJobs::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 13
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
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
}