GravitonBundleBundle::getBundles()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 9.7
c 0
b 0
f 0
cc 2
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  https://opensource.org/licenses/MIT MIT 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[]
0 ignored issues
show
Documentation introduced by
Should the return type not be object[]?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
27
     */
28 6
    public function getBundles()
29
    {
30
        $bundles = array(
31 6
            new GravitonCoreBundle()
32
        );
33
34
        /*** LOOK AFTER DYNAMIC BUNDLEBUNDLE ***/
35
36
        // @todo it seems we have no container at this point - how to make this configurable?
37 6
        $dynamicBundleBundle = '\GravitonDyn\BundleBundle\GravitonDynBundleBundle';
38
39 6
        if (class_exists($dynamicBundleBundle)) {
40 6
            $bundles[] = new $dynamicBundleBundle();
41
        }
42
43 6
        return $bundles;
44
    }
45
}
46