PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 151
Lasso Lite – Affiliate Link Manager & Product Displays v151
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
simple-urls / libs / Raven / ReprSerializer.php

ReprSerializer.php in Lasso Lite – Affiliate Link Manager & Product Displays 151, at libs/Raven/ReprSerializer.php

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of Raven.
5 *
6 * (c) Sentry Team
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 /**
13 * Serializes a value into a representation that should reasonably suggest
14 * both the type and value, and be serializable into JSON.
15 * @package raven
16 */
17 class Raven_ReprSerializer extends Raven_Serializer
18 {
19 protected function serializeValue($value)
20 {
21 if ($value === null) {
22 return 'null';
23 } elseif ($value === false) {
24 return 'false';
25 } elseif ($value === true) {
26 return 'true';
27 } elseif (is_float($value) && (int) $value == $value) {
28 return $value.'.0';
29 } elseif (is_integer($value) || is_float($value)) {
30 return (string) $value;
31 } elseif (is_object($value) || gettype($value) == 'object') {
32 return 'Object '.get_class($value);
33 } elseif (is_resource($value)) {
34 return 'Resource '.get_resource_type($value);
35 } elseif (is_array($value)) {
36 return 'Array of length ' . count($value);
37 } else {
38 return $this->serializeString($value);
39 }
40 }
41 }
42