Browse code

ViewEngine check if registered class exists

RafaƂ Szklarczyk authored on 12/06/2019 11:32:30
Showing 1 changed files
... ...
@@ -11,6 +11,9 @@ class ViewEngine{
11 11
     }
12 12
 
13 13
     public function register($fileExtension, $viewEngine){
14
+        if(!class_exists($viewEngine,true)){
15
+            throw new \Exception("Class \"$viewEngine\" not found!");
16
+        }
14 17
         if(!isset(class_implements($viewEngine, true)['IViewEngine'])){
15 18
             throw new \Exception("Class \"$viewEngine\" does not implement IViewEngine interface!");
16 19
         }