Browse code

namespace fixes in interface check

RafaƂ Szklarczyk authored on 12/06/2019 11:39:10
Showing 2 changed files
... ...
@@ -11,7 +11,12 @@ class Serialization{
11 11
     }
12 12
 
13 13
     public function register($contentType, $serializer, $viewModelClass = null){
14
-        if(!isset(class_implements($serializer, true)['ISerializer'])){
14
+        
15
+        if(!class_exists($serializer,true)){
16
+            throw new \Exception("Class \"$serializer\" not found!");
17
+        }
18
+
19
+        if(!isset(class_implements($serializer, true)['elanpl\\L3\\ISerializer'])){
15 20
             throw new \Exception("Class \"$serializer\" does not implement ISerializer interface!");
16 21
         }
17 22
 
... ...
@@ -14,7 +14,7 @@ class ViewEngine{
14 14
         if(!class_exists($viewEngine,true)){
15 15
             throw new \Exception("Class \"$viewEngine\" not found!");
16 16
         }
17
-        if(!isset(class_implements($viewEngine, true)['IViewEngine'])){
17
+        if(!isset(class_implements($viewEngine, true)['elanpl\\L3\\IViewEngine'])){
18 18
             throw new \Exception("Class \"$viewEngine\" does not implement IViewEngine interface!");
19 19
         }
20 20