Completed
Push — master ( 09db4e...e5b2f0 )
by Florian
02:51
created

StingerSoftPlatformBundle::getRequiredBundles()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 22
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 22
rs 9.2
cc 2
eloc 19
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 getRequiredBundles($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
		$bundles['DoctrineBehaviorsBundle'] = '\Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle';
28
		
29
		if(in_array($env, [
30
			'dev',
31
			'test' 
32
		], true)) {
33
			$bundles['DebugBundle'] = '\Symfony\Bundle\DebugBundle\DebugBundle';
34
			$bundles['WebProfilerBundle'] = '\Symfony\Bundle\WebProfilerBundle\WebProfilerBundle';
35
			$bundles['SensioDistributionBundle'] = '\Sensio\Bundle\DistributionBundle\SensioDistributionBundle';
36
			$bundles['SensioGeneratorBundle'] = '\Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle';
37
		}
38
		return $bundles;
39
	}
40
	
41
	
42
	public static function initBundles(array $bundles){
43
		$result = [];
44
		foreach($bundles as $bundle){
45
			$result[] = new $bundle;
46
		}
47
		return $result;
48
	}
49
}
50