@@ -72,7 +72,7 @@ |
||
72 | 72 | * |
73 | 73 | * @author Alireza Josheghani <[email protected]> |
74 | 74 | * @since 11 Nov 2016 |
75 | - * @param $message |
|
75 | + * @param string $message |
|
76 | 76 | * @return \Anetwork\Respond\Facades\Respond |
77 | 77 | */ |
78 | 78 | protected function errorException($message) |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | |
40 | 40 | $this->getTrace($exception); |
41 | 41 | |
42 | - if($exception instanceof ModelNotFoundException){ |
|
42 | + if ($exception instanceof ModelNotFoundException) { |
|
43 | 43 | return $this->modelNotFound($message); |
44 | - } elseif($exception instanceof NotFoundHttpException){ |
|
44 | + } elseif ($exception instanceof NotFoundHttpException) { |
|
45 | 45 | return $this->httpNotFound(); |
46 | - } elseif($exception instanceof BadRequestHttpException) { |
|
46 | + } elseif ($exception instanceof BadRequestHttpException) { |
|
47 | 47 | return $this->badRequest($message); |
48 | 48 | } |
49 | 49 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | protected function isApiCall(Request $request) |
131 | 131 | { |
132 | - if(strpos($request->getUri(), 'api') || $request->wantsJson()){ |
|
132 | + if (strpos($request->getUri(), 'api') || $request->wantsJson()) { |
|
133 | 133 | return true; |
134 | 134 | } |
135 | 135 | |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | * @param Exception $exception |
145 | 145 | * @return void |
146 | 146 | */ |
147 | - private function getTrace(Exception $exception){ |
|
147 | + private function getTrace(Exception $exception) { |
|
148 | 148 | |
149 | - if(config('app.debug')){ |
|
149 | + if (config('app.debug')) { |
|
150 | 150 | |
151 | 151 | $traces = $exception->getTrace(); |
152 | 152 | |
153 | - if(! empty($traces)){ |
|
154 | - foreach ($traces as $trace){ |
|
153 | + if (!empty($traces)) { |
|
154 | + foreach ($traces as $trace) { |
|
155 | 155 | unset($trace['args']); |
156 | 156 | $this->trace[] = $trace; |
157 | 157 | } |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | * @param Exception $exception |
171 | 171 | * @return \Anetwork\Respond\Facades\Respond |
172 | 172 | */ |
173 | - public function renderRestException(Request $request, Exception $exception){ |
|
173 | + public function renderRestException(Request $request, Exception $exception) { |
|
174 | 174 | |
175 | - if(! $this->isApiCall($request)) { |
|
175 | + if (!$this->isApiCall($request)) { |
|
176 | 176 | return parent::render($request, $exception); |
177 | 177 | } |
178 | 178 |