Completed
Push — master ( 0576d5...c4f381 )
by Askupa
01:58
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
     public static function get_url( $path )
@@ -73,8 +74,7 @@  discard block
 block discarded – undo
73 74
             if( file_exists( $file_name ) ) 
74 75
             {
75 76
                 require_once $file_name;
76
-            }
77
-            else 
77
+            } else 
78 78
             {
79 79
                 throw new \RuntimeException("A component of type '$type' does not exist.");
80 80
             }
Please login to merge, or discard this patch.