@@ -46,8 +46,9 @@ discard block |
||
| 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 |
||
| 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 | } |