PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.24
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.24
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
woocommerce-pos / vendor_prefixed / sentry / sentry / src / Serializer / Traits / StacktraceFrameSeralizerTrait.php

StacktraceFrameSeralizerTrait.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.24, at vendor_prefixed/sentry/sentry/src/Serializer/Traits/StacktraceFrameSeralizerTrait.php

55 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace WCPOS\Vendor\Sentry\Serializer\Traits;
5
6 use WCPOS\Vendor\Sentry\Frame;
7 /**
8 * @internal
9 */
10 trait StacktraceFrameSeralizerTrait
11 {
12 /**
13 * @return array<string, mixed>
14 *
15 * @phpstan-return array{
16 * filename: string,
17 * lineno: int,
18 * in_app: bool,
19 * abs_path?: string,
20 * function?: string,
21 * raw_function?: string,
22 * pre_context?: string[],
23 * context_line?: string,
24 * post_context?: string[],
25 * vars?: array<string, mixed>
26 * }
27 */
28 protected static function serializeStacktraceFrame(Frame $frame) : array
29 {
30 $result = ['filename' => $frame->getFile(), 'lineno' => $frame->getLine(), 'in_app' => $frame->isInApp()];
31 if ($frame->getAbsoluteFilePath() !== null) {
32 $result['abs_path'] = $frame->getAbsoluteFilePath();
33 }
34 if ($frame->getFunctionName() !== null) {
35 $result['function'] = $frame->getFunctionName();
36 }
37 if ($frame->getRawFunctionName() !== null) {
38 $result['raw_function'] = $frame->getRawFunctionName();
39 }
40 if (!empty($frame->getPreContext())) {
41 $result['pre_context'] = $frame->getPreContext();
42 }
43 if ($frame->getContextLine() !== null) {
44 $result['context_line'] = $frame->getContextLine();
45 }
46 if (!empty($frame->getPostContext())) {
47 $result['post_context'] = $frame->getPostContext();
48 }
49 if (!empty($frame->getVars())) {
50 $result['vars'] = $frame->getVars();
51 }
52 return $result;
53 }
54 }
55