From 3c288eb119f4dd821a10ea59346135a4bc3197ad Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Fri, 18 Nov 2022 18:04:58 +0100 Subject: [PATCH] CallablePlugin: Inherit from ClosurePlugin --- build/kint.phar | Bin 433924 -> 433587 bytes src/Renderer/Rich/CallablePlugin.php | 13 ++----------- src/Renderer/RichRenderer.php | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/build/kint.phar b/build/kint.phar index d6c1843a9547e89ed6cc9f8522ef5e6443384073..f72b9531dfcc1631c4ddcdfefa1214010f5b2242 100644 GIT binary patch delta 222 zcmZqKC$)LE)CO%qf$ahe3=R8qWI%M(KNq{r)`Ewa1yp<>q98iq^)Z)bUeR`5QAQwU z+RiJ=Y`>q~IVZokv?z7@gUc-9)Bi7KX5T*P3bPR7^a-8J9MkJMnAxT;uVoRQer5)< z&~$@JHlgYNCo>66S6Ix#ww>`hGvk!$BDpNu?XlS`K+L*5Hk&Qp*dtp0ft28P|DHFe zIOo(ox|8tYl^(;6W9w{;Q&LWBdirI(%V~$!s`tG@XjXLlN#vak!Kr5DJ#4I=6poWc&4^{K@kCT}crk`KP!nXav zRc6L1{1A)O6>RMkf-;jcrc0SI%D3OoWC3Ev)}p5F%Xe;zi4@kSDJ-^ Kfx+F$*9icBjgHR% diff --git a/src/Renderer/Rich/CallablePlugin.php b/src/Renderer/Rich/CallablePlugin.php index 043c2110d..744380524 100644 --- a/src/Renderer/Rich/CallablePlugin.php +++ b/src/Renderer/Rich/CallablePlugin.php @@ -33,7 +33,7 @@ use Kint\Zval\MethodValue; use Kint\Zval\Value; -class CallablePlugin extends AbstractPlugin implements ValuePluginInterface +class CallablePlugin extends ClosurePlugin { protected static $method_cache = []; @@ -46,21 +46,12 @@ public function renderValue(Value $o): ?string } if ($o instanceof ClosureValue) { - return $this->getClosurePlugin()->renderValue($o); + return parent::renderValue($o); } return null; } - protected function getClosurePlugin(): ClosurePlugin - { - if (null === $this->closure_plugin) { - $this->closure_plugin = new ClosurePlugin($this->renderer); - } - - return $this->closure_plugin; - } - protected function renderMethod(MethodValue $o): string { if (!empty(self::$method_cache[$o->owner_class][$o->name])) { diff --git a/src/Renderer/RichRenderer.php b/src/Renderer/RichRenderer.php index ecedb40b5..f206e560c 100644 --- a/src/Renderer/RichRenderer.php +++ b/src/Renderer/RichRenderer.php @@ -52,7 +52,6 @@ class RichRenderer extends AbstractRenderer 'array_limit' => Rich\ArrayLimitPlugin::class, 'blacklist' => Rich\BlacklistPlugin::class, 'callable' => Rich\CallablePlugin::class, - 'closure' => Rich\ClosurePlugin::class, 'color' => Rich\ColorPlugin::class, 'depth_limit' => Rich\DepthLimitPlugin::class, 'recursion' => Rich\RecursionPlugin::class,