|
28 | 28 | - [has\_public\_method](#has_public_method) |
29 | 29 | - [carbon](#carbon) |
30 | 30 | - [temporary_file](#temporary_file) |
31 | | -- [Debug global helper functions](#debug-global-helper-functions) |
32 | | - - [sss](#sss) |
33 | | - - [ddd](#ddd) |
34 | | - - [sss_if](#sss_if) |
35 | | - - [ddd_if](#ddd_if) |
36 | 31 | - [Class helpers](#class-helpers) |
37 | 32 | - [Constants trait](#constants-trait) |
38 | 33 | - [Retrieving constants](#retrieving-constants) |
@@ -300,82 +295,6 @@ temporary_file(); |
300 | 295 | */ |
301 | 296 | ``` |
302 | 297 |
|
303 | | -## Global debug helper functions |
304 | | - |
305 | | -### sss |
306 | | - |
307 | | -Display structured debug information about one or more values **in plain text** using Kint and halt script execution afterwards. Accepts multiple arguments to dump. |
308 | | - |
309 | | -Output will be identical to `ddd` when used in a command line interface. In a browser, it'll display plain, but structured text. |
310 | | - |
311 | | -Requires the [kint-php/kint](https://github.com/raveren/kint) package. |
312 | | - |
313 | | -```php |
314 | | -sss('string'); |
315 | | - |
316 | | -/* |
317 | | -┌─────────────────────────────────────────┐ |
318 | | -│ literal │ |
319 | | -└─────────────────────────────────────────┘ |
320 | | -string (6) "string" |
321 | | -═══════════════════════════════════════════ |
322 | | -Called from .../src/MyClass.php:42 |
323 | | -*/ |
324 | | - |
325 | | -sss('string', 0.42, ['array']); |
326 | | - |
327 | | -/* |
328 | | -┌─────────────────────────────────────────┐ |
329 | | -│ literal │ |
330 | | -└─────────────────────────────────────────┘ |
331 | | -string (6) "string" |
332 | | -┌─────────────────────────────────────────┐ |
333 | | -│ literal │ |
334 | | -└─────────────────────────────────────────┘ |
335 | | -double 0.42 |
336 | | -┌─────────────────────────────────────────┐ |
337 | | -│ literal │ |
338 | | -└─────────────────────────────────────────┘ |
339 | | -array (1) [ |
340 | | - 0 => string (5) "array" |
341 | | -] |
342 | | -═══════════════════════════════════════════ |
343 | | -Called from .../src/MyClass.php:42 |
344 | | -*/ |
345 | | -``` |
346 | | - |
347 | | -### ddd |
348 | | - |
349 | | -Display structured debug information about one or more values using Kint and halt script execution afterwards. Accepts multiple arguments to dump. Output will be identical to `sss` when used in a command line interface. In a browser, it'll display an interactive, structured tree-view. |
350 | | - |
351 | | -Requires the [kint-php/kint](https://github.com/raveren/kint) package. |
352 | | - |
353 | | -See the [sss helper](#sss) for example output. |
354 | | - |
355 | | -### sss_if |
356 | | - |
357 | | -Display structured debug information about one or more values **in plain text** using Kint and halt script execution afterwards, but only if the condition is truthy. Does nothing if falsy. Accepts multiple arguments to dump. |
358 | | - |
359 | | -Requires the [kint-php/kint](https://github.com/raveren/kint) package. |
360 | | - |
361 | | -```php |
362 | | -sss_if($user->last_name, 'User has a last name', $user->last_name); |
363 | | -``` |
364 | | - |
365 | | -See the [sss helper](#sss) for example output. |
366 | | - |
367 | | -### ddd_if |
368 | | - |
369 | | -Display structured debug information about one or more values using Kint and halt script execution afterwards, but only if the condition is truthy. Does nothing if falsy. Accepts multiple arguments to dump. |
370 | | - |
371 | | -Requires the [kint-php/kint](https://github.com/raveren/kint) package. |
372 | | - |
373 | | -```php |
374 | | -ddd_if(app()->environment('local'), 'Debugging in a local environment!'); |
375 | | -``` |
376 | | - |
377 | | -See the [ddd helper](#ddd) for example output. |
378 | | - |
379 | 298 | ## Class helpers |
380 | 299 |
|
381 | 300 | ### Enum trait |
|
0 commit comments