1 | <?php |
||
17 | abstract class Exception extends SymfonyHttpException |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * MessageBag errors. |
||
22 | * |
||
23 | * @var \Illuminate\Support\MessageBag |
||
24 | */ |
||
25 | protected $errors; |
||
26 | |||
27 | /** |
||
28 | * Default status code. |
||
29 | * |
||
30 | * @var int |
||
31 | */ |
||
32 | CONST DEFAULT_STATUS_CODE = Response::HTTP_INTERNAL_SERVER_ERROR; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $environment; |
||
38 | |||
39 | /** |
||
40 | * Exception constructor. |
||
41 | * |
||
42 | * @param null $message |
||
43 | * @param null $errors |
||
44 | * @param null $statusCode |
||
45 | * @param int $code |
||
46 | * @param \Exception|null $previous |
||
47 | * @param array $headers |
||
48 | */ |
||
49 | public function __construct( |
||
69 | |||
70 | |||
71 | /** |
||
72 | * Help developers debug the error without showing these details to the end user. |
||
73 | * Usage: `throw (new MyCustomException())->debug($e)`. |
||
74 | * |
||
75 | * @param $error |
||
76 | * @param $force |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function debug($error, $force = false) |
||
92 | |||
93 | /** |
||
94 | * Get the errors message bag. |
||
95 | * |
||
96 | * @return \Illuminate\Support\MessageBag |
||
97 | */ |
||
98 | public function getErrors() |
||
102 | |||
103 | /** |
||
104 | * Determine if message bag has any errors. |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function hasErrors() |
||
112 | |||
113 | |||
114 | /** |
||
115 | * @param $statusCode |
||
116 | * @param $message |
||
117 | * @param $code |
||
118 | */ |
||
119 | private function logTheError($statusCode, $message, $code) |
||
131 | |||
132 | /** |
||
133 | * @param null $errors |
||
134 | * |
||
135 | * @return \Illuminate\Support\MessageBag|null |
||
136 | */ |
||
137 | private function prepareError($errors = null) |
||
141 | |||
142 | /** |
||
143 | * @param array $errors |
||
144 | * |
||
145 | * @return array|\Illuminate\Support\MessageBag |
||
146 | */ |
||
147 | private function prepareArrayError(array $errors = []) |
||
151 | |||
152 | /** |
||
153 | * @param null $message |
||
154 | * |
||
155 | * @return null |
||
156 | */ |
||
157 | private function prepareMessage($message = null) |
||
161 | |||
162 | /** |
||
163 | * @param $statusCode |
||
164 | * |
||
165 | * @return int |
||
166 | */ |
||
167 | private function prepareStatusCode($statusCode = null) |
||
171 | |||
172 | /** |
||
173 | * @return int |
||
174 | */ |
||
175 | private function findStatusCode() |
||
179 | |||
180 | } |
||
181 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.