- Added a new Picea extension
This commit is contained in:
parent
2845badd40
commit
b3936aa6e1
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Taxus\Picea;
|
||||
|
||||
use Picea\Compiler\Context;
|
||||
use Taxus\Taxus;
|
||||
|
||||
class Extension implements \Picea\Extension\Extension
|
||||
{
|
||||
protected Taxus $taxus;
|
||||
|
||||
public function __construct(Context $context, Taxus $taxus)
|
||||
{
|
||||
$this->register($context);
|
||||
|
||||
$this->taxus = $taxus;
|
||||
}
|
||||
|
||||
public function register(Context $context) : void
|
||||
{
|
||||
$context->pushFunction("taxus", [ $this, 'taxus' ]);
|
||||
}
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, ?string $arguments, string $token) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public function taxus(string $name, ...$arguments) : bool
|
||||
{
|
||||
return $this->taxus->granted($name, ...$arguments);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue