Completed
Push — feature/fix-somescrutinizer-is... ( 840c34...8bd6e3 )
by Narcotic
15:02 queued 08:41
created

GravitonBundleBundle::getBundles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2
Metric Value
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 9.4286
cc 2
eloc 7
nc 2
nop 0
crap 2
1
<?php
2
/**
3
 * Bundle for auto-registration of bundles in graviton
4
 */
5
6
namespace Graviton\BundleBundle;
7
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
use Graviton\CoreBundle\GravitonCoreBundle;
10
11
/**
12
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
13
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
14
 * @link     http://swisscom.ch
15
 */
16
class GravitonBundleBundle extends Bundle implements GravitonBundleInterface
17
{
18
    /**
19
     * {@inheritDoc}
20
     *
21
     * This serves as kickstarter by instanciating core bundle. It has not
22
     * yet been decided where the remaining GravitonBundles get loaded.
23
     *
24
     * @todo GravitonBundle loading/disco (maybe with command support).
25
     *
26
     * @return \Symfony\Component\HttpKernel\Bundle\Bundle[]
27
     */
28 7
    public function getBundles()
29
    {
30
        $bundles = array(
31 7
            new GravitonCoreBundle()
32 7
        );
33
34
        /*** LOOK AFTER DYNAMIC BUNDLEBUNDLE ***/
35
36
        // @todo it seems we have no container at this point - how to make this configurable?
37 7
        $dynamicBundleBundle = '\GravitonDyn\BundleBundle\GravitonDynBundleBundle';
38
39 7
        if (class_exists($dynamicBundleBundle)) {
40 7
            $bundles[] = new $dynamicBundleBundle();
41 7
        }
42
43 7
        return $bundles;
44
    }
45
}
46