madlisp/src/Func.php

29 lines
483 B
PHP
Raw Normal View History

<?php
namespace MadLisp;
use Closure;
abstract class Func
{
protected Closure $closure;
2020-06-01 13:19:26 +00:00
protected ?string $doc;
2020-06-01 13:19:26 +00:00
public function __construct(Closure $closure, ?string $doc = null)
{
$this->closure = $closure;
2020-06-01 13:19:26 +00:00
$this->doc = $doc;
}
public function getClosure(): Closure
{
return $this->closure;
}
2020-06-01 13:19:26 +00:00
public function getDoc(): ?string
{
return $this->doc;
}
abstract public function call(array $args);
}