File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use frictionlessdata \datapackage \Datapackages \BaseDatapackage ;
66use frictionlessdata \datapackage \Resources \BaseResource ;
7+ use frictionlessdata \tableschema \SchemaValidationError ;
78use ZipArchive ;
89
910/**
@@ -39,9 +40,7 @@ public static function datapackage($source, $basePath = null)
3940 $ descriptor = $ source ->descriptor ;
4041 $ basePath = $ source ->basePath ;
4142 $ datapackageClass = static ::getDatapackageClass ($ descriptor );
42- $ datapackage = new $ datapackageClass ($ descriptor , $ basePath );
43-
44- return $ datapackage ;
43+ return new $ datapackageClass ($ descriptor , $ basePath );
4544 }
4645
4746 /**
@@ -94,7 +93,7 @@ public static function validate($source, $basePath = null)
9493 // return a list containing a single LOAD_FAILED validation error
9594 return [
9695 new Validators \DatapackageValidationError (
97- Validators \DatapackageValidationError ::LOAD_FAILED ,
96+ SchemaValidationError ::LOAD_FAILED ,
9897 $ e ->getMessage ()
9998 ),
10099 ];
@@ -291,7 +290,7 @@ protected static function loadSource($source, $basePath)
291290 $ basePath = null ;
292291 }
293292 } else {
294- // not a json string and not a url - assume it's a file path
293+ // not a json string and not an url - assume it's a file path
295294 if (static ::isFileZipSource ($ source )) {
296295 return static ::loadFileZipSource ($ source );
297296 } else {
You can’t perform that action at this time.
0 commit comments