BundleProcessor::getBundles()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Borobudur-Kernel package.
4
 *
5
 * (c) Hexacodelabs <http://hexacodelabs.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Borobudur\Kernel\Processor;
12
13
use Borobudur\Kernel\KernelInterface;
14
15
/**
16
 * @author      Iqbal Maulana <[email protected]>
17
 * @created     8/17/15
18
 */
19
class BundleProcessor implements ProcessorInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function initialize(KernelInterface $kernel)
25
    {
26
        $kernel->getBundleManager()->add($this->getBundles($kernel));
27
    }
28
29
    /**
30
     * Get bundles.
31
     *
32
     * @param KernelInterface $kernel
33
     *
34
     * @return array
35
     */
36
    private function getBundles(KernelInterface $kernel)
37
    {
38
        $env = $kernel->getEnvironmentManager()->getEnvInstance();
39
40
        return array_merge((array) $kernel->registerBundles(), (array) $env->registerBundles());
41
    }
42
}
43