PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.25
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.25
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 / BreadcrumbSeralizerTrait.php

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

36 lines 977 B
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\Breadcrumb;
7 /**
8 * @internal
9 */
10 trait BreadcrumbSeralizerTrait
11 {
12 /**
13 * @return array<string, mixed>
14 *
15 * @phpstan-return array{
16 * type: string,
17 * category: string,
18 * level: string,
19 * timestamp: float,
20 * message?: string,
21 * data?: object
22 * }
23 */
24 protected static function serializeBreadcrumb(Breadcrumb $breadcrumb) : array
25 {
26 $result = ['type' => $breadcrumb->getType(), 'category' => $breadcrumb->getCategory(), 'level' => $breadcrumb->getLevel(), 'timestamp' => $breadcrumb->getTimestamp()];
27 if ($breadcrumb->getMessage() !== null) {
28 $result['message'] = $breadcrumb->getMessage();
29 }
30 if (!empty($breadcrumb->getMetadata())) {
31 $result['data'] = (object) $breadcrumb->getMetadata();
32 }
33 return $result;
34 }
35 }
36