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

GravitonBundleBundle   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 30
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getBundles() 0 17 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