diff --git a/extend/catcher/CatchAdmin.php b/extend/catcher/CatchAdmin.php index bd5390f..5e07f85 100644 --- a/extend/catcher/CatchAdmin.php +++ b/extend/catcher/CatchAdmin.php @@ -1,4 +1,6 @@ getExtension() === 'php') { - $lastPath = str_replace($this->parseNamespace(), '',pathinfo($command, PATHINFO_DIRNAME)); + $lastPath = str_replace($this->parseNamespace(), '', pathinfo($command->getPathname(), PATHINFO_DIRNAME)); $namespace = $this->namespace . str_replace(DIRECTORY_SEPARATOR, '\\', $lastPath) . '\\'; - $commandClass = $namespace . pathinfo($command, PATHINFO_FILENAME); + $commandClass = $namespace . pathinfo($command->getPathname(), PATHINFO_FILENAME); $commands[] = $commandClass; } } diff --git a/extend/catcher/CatchExceptionHandle.php b/extend/catcher/CatchExceptionHandle.php index 3f068ee..e86ea2f 100644 --- a/extend/catcher/CatchExceptionHandle.php +++ b/extend/catcher/CatchExceptionHandle.php @@ -1,4 +1,6 @@ $code, - 'message' => $msg, - 'data' => $data, - ]); + return json([ + 'code' => $code, + 'message' => $msg, + 'data' => $data, + ]); } /** @@ -35,14 +35,14 @@ class CatchResponse */ public static function paginate(Paginator $list) { - return json([ - 'code' => Code::SUCCESS, - 'message' => 'success', - 'count' => $list->total(), - 'current' => $list->currentPage(), - 'limit' => $list->listRows(), - 'data' => $list->getCollection(), - ]); + return json([ + 'code' => Code::SUCCESS, + 'message' => 'success', + 'count' => $list->total(), + 'current' => $list->currentPage(), + 'limit' => $list->listRows(), + 'data' => $list->getCollection(), + ]); } /** @@ -55,9 +55,9 @@ class CatchResponse */ public static function fail($msg = '', $code = Code::FAILED): Json { - return json([ - 'code' => $code, - 'message' => $msg, - ]); + return json([ + 'code' => $code, + 'message' => $msg, + ]); } } diff --git a/extend/catcher/CatchUpload.php b/extend/catcher/CatchUpload.php index 422d1b9..1ce64e2 100644 --- a/extend/catcher/CatchUpload.php +++ b/extend/catcher/CatchUpload.php @@ -1,4 +1,6 @@