Completed
Push — master ( 034197...09db4e )
by Florian
14:50 queued 15s
created

StingerSoftPlatformBundle::initBundles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Stinger Soft Platform package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace StingerSoft\PlatformBundle;
13
14
use Symfony\Component\HttpKernel\Bundle\Bundle;
15
16
class StingerSoftPlatformBundle extends Bundle {
17
18
	public static function getRequiredBundle($env) {
19
		$bundles = [];
20
		$bundles['FrameworkBundle'] = '\Symfony\Bundle\FrameworkBundle\FrameworkBundle';
21
		$bundles['SecurityBundle'] = '\Symfony\Bundle\SecurityBundle\SecurityBundle';
22
		$bundles['TwigBundle'] = '\Symfony\Bundle\TwigBundle\TwigBundle';
23
		$bundles['MonologBundle'] = '\Symfony\Bundle\MonologBundle\MonologBundle';
24
		$bundles['SwiftmailerBundle'] = '\Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle';
25
		$bundles['DoctrineBundle'] = '\Doctrine\Bundle\DoctrineBundle\DoctrineBundle';
26
		$bundles['SensioFrameworkExtraBundle'] = '\Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle';
27
		
28
		if(in_array($env, [
29
			'dev',
30
			'test' 
31
		], true)) {
32
			$bundles['DebugBundle'] = '\Symfony\Bundle\DebugBundle\DebugBundle';
33
			$bundles['WebProfilerBundle'] = '\Symfony\Bundle\WebProfilerBundle\WebProfilerBundle';
34
			$bundles['SensioDistributionBundle'] = '\Sensio\Bundle\DistributionBundle\SensioDistributionBundle';
35
			$bundles['SensioGeneratorBundle'] = '\Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle';
36
		}
37
		return $bundles;
38
	}
39
	
40
	
41
	public static function initBundles(array $bundles){
42
		$result = [];
43
		foreach($bundles as $bundle){
44
			$result[] = new $bundle;
45
		}
46
		return $result;
47
	}
48
}
49