Skip to content

Commit

Permalink
CallablePlugin: Inherit from ClosurePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Nov 18, 2022
1 parent 38a7859 commit 3c288eb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
Binary file modified build/kint.phar
Binary file not shown.
13 changes: 2 additions & 11 deletions src/Renderer/Rich/CallablePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand All @@ -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])) {
Expand Down
1 change: 0 additions & 1 deletion src/Renderer/RichRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3c288eb

Please sign in to comment.