@@ -47,8 +47,9 @@ discard block |
||
| 47 | 47 | if( !in_array($type, $this->registered_components) ) |
| 48 | 48 | { |
| 49 | 49 | $this->registered_components[$type] = $class_name; |
| 50 | + } else { |
|
| 51 | + throw new \RuntimeException("A component of type '$type' has already been registered."); |
|
| 50 | 52 | } |
| 51 | - else throw new \RuntimeException("A component of type '$type' has already been registered."); |
|
| 52 | 53 | } |
| 53 | 54 | |
| 54 | 55 | /** |
@@ -85,8 +86,7 @@ discard block |
||
| 85 | 86 | if( file_exists( $file_name ) ) |
| 86 | 87 | { |
| 87 | 88 | require_once $file_name; |
| 88 | - } |
|
| 89 | - else |
|
| 89 | + } else |
|
| 90 | 90 | { |
| 91 | 91 | throw new \RuntimeException("A component of type '$type' does not exist."); |
| 92 | 92 | } |