From a913d1151050344ad73c55d5470a8bd23e49c669 Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Sat, 18 Dec 2021 13:05:36 +0100 Subject: [PATCH] More edge-case cleanup --- build/kint.phar | Bin 406972 -> 407046 bytes src/Parser/TimestampPlugin.php | 2 +- src/Renderer/RichRenderer.php | 5 +++-- .../Representation/ColorRepresentation.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/kint.phar b/build/kint.phar index f06d47500738871eed6154f00e3213b5148ba84c..9cb586c5986212f1b12a7a2221326f0a1f01fefb 100644 GIT binary patch delta 259 zcmdnfoe_$hK7AQG9dc<|7!;~SMu7i3H)=1h=S;{7pJ8sI|xW_ejr@O zEbtX71EQzj$tY{i6K~HGXWX7A&b0d3^ySBx_}bROo$2{F?dP6J=*YpE1Ec_f{ zi8-aI8Y=nI8O4}|r#DEja86&dl_haH?*SI>>A%~Ud8eP-#=^7R&ys~rgFUY_Cr3fi zc6wkdvuJxjBFpxGMAqNh+k<;q6<2t~E^fg(-@hK7AQG9Y@j-k;vhmArOr0$bf7q9FQv#GIDN4g!*!9|+em z3;c!3fM{;7%tg(4;_Z3jjN9|XnN~lWF0_bIxZU(0({|H;%$-)#19mX;PTz0AqB!00 zEtB+i151`LjrL`UEZdhQvVPZQ*GS9BPb|^gKBt#eX@$p~=To2YU!K~1zU_MD*EeqK z=5M@lHU6mmmAvNZ6QpaoZY-)lSs%-0^j7_Cbxa%oY+kYcdg=MrDksgt=Bmj&zq^}- Lfq}u@$=3-0*wt5w diff --git a/src/Parser/TimestampPlugin.php b/src/Parser/TimestampPlugin.php index 37db2ac79..fa8d743de 100644 --- a/src/Parser/TimestampPlugin.php +++ b/src/Parser/TimestampPlugin.php @@ -56,7 +56,7 @@ public function parse(&$var, Value &$o, $trigger) return; } - $len = \strlen($var); + $len = \strlen((string) $var); // Guess for anything between March 1973 and November 2286 if (9 === $len || 10 === $len) { diff --git a/src/Renderer/RichRenderer.php b/src/Renderer/RichRenderer.php index e7fe27c15..94b7f98ab 100644 --- a/src/Renderer/RichRenderer.php +++ b/src/Renderer/RichRenderer.php @@ -215,7 +215,8 @@ public function getUseFolder() public function render(Value $o) { if ($plugin = $this->getPlugin(self::$value_plugins, $o->hints)) { - if (\strlen($output = $plugin->renderValue($o))) { + $output = $plugin->renderValue($o); + if (null !== $output && \strlen($output)) { return $output; } } @@ -566,7 +567,7 @@ protected function renderTab(Value $o, Representation $rep) } else { if (\preg_match('/(:?[\\r\\n\\t\\f\\v]| {2})/', $rep->contents)) { $show_contents = true; - } elseif (self::$strlen_max && BlobValue::strlen($o->getValueShort()) > self::$strlen_max) { + } elseif (self::$strlen_max && null !== $o->getValueShort() && BlobValue::strlen($o->getValueShort()) > self::$strlen_max) { $show_contents = true; } diff --git a/src/Zval/Representation/ColorRepresentation.php b/src/Zval/Representation/ColorRepresentation.php index 673a42b4b..533ccb35d 100644 --- a/src/Zval/Representation/ColorRepresentation.php +++ b/src/Zval/Representation/ColorRepresentation.php @@ -540,7 +540,7 @@ public static function rgbToHsl($red, $green, $blue) } return [ - (float) \fmod($H * 360, 360), + \fmod($H * 360, 360), (float) ($S * 100), (float) ($L * 100), ];