Completed
Push — master ( 5ac3d3...00813e )
by Askupa
02:22
created
ComponentFactory.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,8 +46,9 @@  discard block
 block discarded – undo
46 46
         if( !in_array($type, self::$registered_components) )
47 47
         {
48 48
             self::$registered_components[$type] = $class_name;
49
+        } else {
50
+            throw new \RuntimeException("A component of type '$type' has already been registered.");
49 51
         }
50
-        else throw new \RuntimeException("A component of type '$type' has already been registered.");
51 52
     }
52 53
     
53 54
     /**
@@ -67,8 +68,7 @@  discard block
 block discarded – undo
67 68
             if( file_exists( $file_name ) ) 
68 69
             {
69 70
                 require_once $file_name;
70
-            }
71
-            else 
71
+            } else 
72 72
             {
73 73
                 throw new \RuntimeException("A component of type '$type' does not exist.");
74 74
             }
Please login to merge, or discard this patch.