gl-website-deployer/vendor/doctrine/rst-parser/lib/Renderers/CallableNodeRendererFactory.php

24 lines
430 B
PHP
Raw Permalink Normal View History

2024-11-19 08:02:04 +01:00
<?php
declare(strict_types=1);
namespace Doctrine\RST\Renderers;
use Doctrine\RST\Nodes\Node;
final class CallableNodeRendererFactory implements NodeRendererFactory
{
/** @var callable */
private $callable;
public function __construct(callable $callable)
{
$this->callable = $callable;
}
public function create(Node $node): NodeRenderer
{
return ($this->callable)($node);
}
}