Completed
Branch master (0175b6)
by Benjamin
28:14 queued 02:07
created
src/Alpixel/Bundle/CMSBundle/DependencyInjection/CMSExtension.php 1 patch
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -21,31 +21,38 @@
 block discarded – undo
21 21
 
22 22
         foreach($config['content_types'] as $name=>$contentType) {
23 23
 
24
-            if(empty($contentType['title']))
25
-                throw new InvalidConfigurationException('Content type '.$name.' shoud have a title');
24
+            if(empty($contentType['title'])) {
25
+                            throw new InvalidConfigurationException('Content type '.$name.' shoud have a title');
26
+            }
26 27
 
27
-            if(empty($contentType['description']))
28
-                throw new InvalidConfigurationException('Content type '.$name.' shoud have a description');
28
+            if(empty($contentType['description'])) {
29
+                            throw new InvalidConfigurationException('Content type '.$name.' shoud have a description');
30
+            }
29 31
 
30
-            if(!isset($contentType['class']) || empty($contentType['class']) || !class_exists($contentType['class']))
31
-                throw new InvalidConfigurationException('CMS '.$contentType['class'].' can\'t be found');
32
+            if(!isset($contentType['class']) || empty($contentType['class']) || !class_exists($contentType['class'])) {
33
+                            throw new InvalidConfigurationException('CMS '.$contentType['class'].' can\'t be found');
34
+            }
32 35
 
33
-            if(empty($contentType['controller']))
34
-                throw new InvalidConfigurationException('CMS '.$contentType['controller'].' can\'t be found');
36
+            if(empty($contentType['controller'])) {
37
+                            throw new InvalidConfigurationException('CMS '.$contentType['controller'].' can\'t be found');
38
+            }
35 39
 
36 40
             $container->setParameter('cms.content_types', $config['content_types']);
37 41
         }
38 42
 
39 43
         foreach($config['blocks'] as $name=>$contentType) {
40 44
 
41
-            if(empty($contentType['title']))
42
-                throw new InvalidConfigurationException('Block '.$name.' shoud have a title');
45
+            if(empty($contentType['title'])) {
46
+                            throw new InvalidConfigurationException('Block '.$name.' shoud have a title');
47
+            }
43 48
 
44
-            if( (!isset($contentType['class']) || empty($contentType['class'])) && class_exists($this->_blockDefaultClass) )
45
-                $config['blocks'][$name]['class'] = $this->_blockDefaultClass;
49
+            if( (!isset($contentType['class']) || empty($contentType['class'])) && class_exists($this->_blockDefaultClass) ) {
50
+                            $config['blocks'][$name]['class'] = $this->_blockDefaultClass;
51
+            }
46 52
 
47
-            if(isset($contentType['class']) && !class_exists($contentType['class']))
48
-                throw new InvalidConfigurationException('Block '.$contentType['class'].' can\'t be found');
53
+            if(isset($contentType['class']) && !class_exists($contentType['class'])) {
54
+                            throw new InvalidConfigurationException('Block '.$contentType['class'].' can\'t be found');
55
+            }
49 56
 
50 57
             $container->setParameter('cms.blocks', $config['blocks']);
51 58
         }
Please login to merge, or discard this patch.