@@ -20,48 +20,48 @@ discard block |
||
20 | 20 | const CONTEXT_WEB = 'web'; |
21 | 21 | |
22 | 22 | /** |
23 | - * @var Throwable |
|
24 | - */ |
|
23 | + * @var Throwable |
|
24 | + */ |
|
25 | 25 | protected $exception; |
26 | 26 | |
27 | - /** |
|
28 | - * @var ConvertHelper_ThrowableInfo_Call[] |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var ConvertHelper_ThrowableInfo_Call[] |
|
29 | + */ |
|
30 | 30 | protected $calls = array(); |
31 | 31 | |
32 | - /** |
|
33 | - * @var integer |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @var integer |
|
34 | + */ |
|
35 | 35 | protected $code = 0; |
36 | 36 | |
37 | - /** |
|
38 | - * @var string |
|
39 | - */ |
|
37 | + /** |
|
38 | + * @var string |
|
39 | + */ |
|
40 | 40 | protected $message; |
41 | 41 | |
42 | - /** |
|
43 | - * @var integer |
|
44 | - */ |
|
42 | + /** |
|
43 | + * @var integer |
|
44 | + */ |
|
45 | 45 | protected $callsCount = 0; |
46 | 46 | |
47 | - /** |
|
48 | - * @var ConvertHelper_ThrowableInfo |
|
49 | - */ |
|
47 | + /** |
|
48 | + * @var ConvertHelper_ThrowableInfo |
|
49 | + */ |
|
50 | 50 | protected $previous; |
51 | 51 | |
52 | - /** |
|
53 | - * @var string |
|
54 | - */ |
|
52 | + /** |
|
53 | + * @var string |
|
54 | + */ |
|
55 | 55 | protected $referer = ''; |
56 | 56 | |
57 | - /** |
|
58 | - * @var Microtime |
|
59 | - */ |
|
57 | + /** |
|
58 | + * @var Microtime |
|
59 | + */ |
|
60 | 60 | protected $date; |
61 | 61 | |
62 | - /** |
|
63 | - * @var string |
|
64 | - */ |
|
62 | + /** |
|
63 | + * @var string |
|
64 | + */ |
|
65 | 65 | protected $context = self::CONTEXT_WEB; |
66 | 66 | |
67 | 67 | /** |
@@ -127,16 +127,16 @@ discard block |
||
127 | 127 | return isset($this->previous); |
128 | 128 | } |
129 | 129 | |
130 | - /** |
|
131 | - * Retrieves the information on the previous exception. |
|
132 | - * |
|
133 | - * NOTE: Throws an exception if there is no previous |
|
134 | - * exception. Use hasPrevious() first to avoid this. |
|
135 | - * |
|
136 | - * @throws ConvertHelper_Exception |
|
137 | - * @return ConvertHelper_ThrowableInfo |
|
138 | - * @see ConvertHelper_ThrowableInfo::ERROR_NO_PREVIOUS_EXCEPTION |
|
139 | - */ |
|
130 | + /** |
|
131 | + * Retrieves the information on the previous exception. |
|
132 | + * |
|
133 | + * NOTE: Throws an exception if there is no previous |
|
134 | + * exception. Use hasPrevious() first to avoid this. |
|
135 | + * |
|
136 | + * @throws ConvertHelper_Exception |
|
137 | + * @return ConvertHelper_ThrowableInfo |
|
138 | + * @see ConvertHelper_ThrowableInfo::ERROR_NO_PREVIOUS_EXCEPTION |
|
139 | + */ |
|
140 | 140 | public function getPrevious() : ConvertHelper_ThrowableInfo |
141 | 141 | { |
142 | 142 | if(isset($this->previous)) { |
@@ -155,68 +155,68 @@ discard block |
||
155 | 155 | return !empty($this->code); |
156 | 156 | } |
157 | 157 | |
158 | - /** |
|
159 | - * Improved text-only exception trace. |
|
160 | - */ |
|
158 | + /** |
|
159 | + * Improved text-only exception trace. |
|
160 | + */ |
|
161 | 161 | public function toString() : string |
162 | 162 | { |
163 | 163 | return (new ConvertHelper_ThrowableInfo_StringConverter($this)) |
164 | 164 | ->toString(); |
165 | 165 | } |
166 | 166 | |
167 | - /** |
|
168 | - * Retrieves the URL of the page in which the exception |
|
169 | - * was thrown, if applicable: in CLI context, this will |
|
170 | - * return an empty string. |
|
171 | - * |
|
172 | - * @return string |
|
173 | - */ |
|
167 | + /** |
|
168 | + * Retrieves the URL of the page in which the exception |
|
169 | + * was thrown, if applicable: in CLI context, this will |
|
170 | + * return an empty string. |
|
171 | + * |
|
172 | + * @return string |
|
173 | + */ |
|
174 | 174 | public function getReferer() : string |
175 | 175 | { |
176 | 176 | return $this->referer; |
177 | 177 | } |
178 | 178 | |
179 | - /** |
|
180 | - * Whether the exception occurred in a command line context. |
|
181 | - * @return bool |
|
182 | - */ |
|
179 | + /** |
|
180 | + * Whether the exception occurred in a command line context. |
|
181 | + * @return bool |
|
182 | + */ |
|
183 | 183 | public function isCommandLine() : bool |
184 | 184 | { |
185 | 185 | return $this->getContext() === self::CONTEXT_COMMAND_LINE; |
186 | 186 | } |
187 | 187 | |
188 | - /** |
|
189 | - * Whether the exception occurred during an http request. |
|
190 | - * @return bool |
|
191 | - */ |
|
188 | + /** |
|
189 | + * Whether the exception occurred during an http request. |
|
190 | + * @return bool |
|
191 | + */ |
|
192 | 192 | public function isWebRequest() : bool |
193 | 193 | { |
194 | 194 | return $this->getContext() === self::CONTEXT_WEB; |
195 | 195 | } |
196 | 196 | |
197 | - /** |
|
198 | - * Retrieves the context identifier, i.e. if the exception |
|
199 | - * occurred in a command line context or regular web request. |
|
200 | - * |
|
201 | - * @return string |
|
202 | - * |
|
203 | - * @see ConvertHelper_ThrowableInfo::isCommandLine() |
|
204 | - * @see ConvertHelper_ThrowableInfo::isWebRequest() |
|
205 | - * @see ConvertHelper_ThrowableInfo::CONTEXT_COMMAND_LINE |
|
206 | - * @see ConvertHelper_ThrowableInfo::CONTEXT_WEB |
|
207 | - */ |
|
197 | + /** |
|
198 | + * Retrieves the context identifier, i.e. if the exception |
|
199 | + * occurred in a command line context or regular web request. |
|
200 | + * |
|
201 | + * @return string |
|
202 | + * |
|
203 | + * @see ConvertHelper_ThrowableInfo::isCommandLine() |
|
204 | + * @see ConvertHelper_ThrowableInfo::isWebRequest() |
|
205 | + * @see ConvertHelper_ThrowableInfo::CONTEXT_COMMAND_LINE |
|
206 | + * @see ConvertHelper_ThrowableInfo::CONTEXT_WEB |
|
207 | + */ |
|
208 | 208 | public function getContext() : string |
209 | 209 | { |
210 | 210 | return $this->context; |
211 | 211 | } |
212 | 212 | |
213 | - /** |
|
214 | - * Retrieves the date of the exception, and approximate time: |
|
215 | - * since exceptions do not store time, this is captured the |
|
216 | - * moment the ThrowableInfo is created. |
|
217 | - * |
|
218 | - * @return Microtime |
|
219 | - */ |
|
213 | + /** |
|
214 | + * Retrieves the date of the exception, and approximate time: |
|
215 | + * since exceptions do not store time, this is captured the |
|
216 | + * moment the ThrowableInfo is created. |
|
217 | + * |
|
218 | + * @return Microtime |
|
219 | + */ |
|
220 | 220 | public function getDate() : Microtime |
221 | 221 | { |
222 | 222 | return $this->date; |
@@ -237,24 +237,24 @@ discard block |
||
237 | 237 | return ConvertHelper_ThrowableInfo_Serializer::serialize($this); |
238 | 238 | } |
239 | 239 | |
240 | - /** |
|
241 | - * Sets the maximum folder depth to show in the |
|
242 | - * file paths, to avoid them being too long. |
|
243 | - * |
|
244 | - * @param int $depth |
|
245 | - * @return ConvertHelper_ThrowableInfo |
|
246 | - */ |
|
240 | + /** |
|
241 | + * Sets the maximum folder depth to show in the |
|
242 | + * file paths, to avoid them being too long. |
|
243 | + * |
|
244 | + * @param int $depth |
|
245 | + * @return ConvertHelper_ThrowableInfo |
|
246 | + */ |
|
247 | 247 | public function setFolderDepth(int $depth) : ConvertHelper_ThrowableInfo |
248 | 248 | { |
249 | 249 | return $this->setOption('folder-depth', $depth); |
250 | 250 | } |
251 | 251 | |
252 | - /** |
|
253 | - * Retrieves the current folder depth option value. |
|
254 | - * |
|
255 | - * @return int |
|
256 | - * @see ConvertHelper_ThrowableInfo::setFolderDepth() |
|
257 | - */ |
|
252 | + /** |
|
253 | + * Retrieves the current folder depth option value. |
|
254 | + * |
|
255 | + * @return int |
|
256 | + * @see ConvertHelper_ThrowableInfo::setFolderDepth() |
|
257 | + */ |
|
258 | 258 | public function getFolderDepth() : int |
259 | 259 | { |
260 | 260 | $depth = $this->getOption('folder-depth'); |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | return 2; |
266 | 266 | } |
267 | 267 | |
268 | - /** |
|
269 | - * Retrieves all function calls that led to the error, |
|
270 | - * ordered from latest to earliest (the first one in |
|
271 | - * the stack is actually the last call). |
|
272 | - * |
|
273 | - * @return ConvertHelper_ThrowableInfo_Call[] |
|
274 | - */ |
|
268 | + /** |
|
269 | + * Retrieves all function calls that led to the error, |
|
270 | + * ordered from latest to earliest (the first one in |
|
271 | + * the stack is actually the last call). |
|
272 | + * |
|
273 | + * @return ConvertHelper_ThrowableInfo_Call[] |
|
274 | + */ |
|
275 | 275 | public function getCalls() |
276 | 276 | { |
277 | 277 | return $this->calls; |
@@ -287,10 +287,10 @@ discard block |
||
287 | 287 | return $this->calls[0]; |
288 | 288 | } |
289 | 289 | |
290 | - /** |
|
291 | - * Returns the amount of function and method calls in the stack trace. |
|
292 | - * @return int |
|
293 | - */ |
|
290 | + /** |
|
291 | + * Returns the amount of function and method calls in the stack trace. |
|
292 | + * @return int |
|
293 | + */ |
|
294 | 294 | public function countCalls() : int |
295 | 295 | { |
296 | 296 | return $this->callsCount; |