- Added a Picea extension
This commit is contained in:
parent
eb378eb21e
commit
401fe15c18
|
@ -13,5 +13,17 @@
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Dump\\": "src/"
|
"Dump\\": "src/"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"lean": {
|
||||||
|
"autoload": {
|
||||||
|
"definitions" : [
|
||||||
|
"meta/definitions/auth.php"
|
||||||
|
],
|
||||||
|
"config": [
|
||||||
|
"meta/config.php"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use function DI\autowire, DI\create, DI\get;
|
||||||
|
|
||||||
|
use Dump\Picea\DumpExtension;
|
||||||
|
|
||||||
|
return [
|
||||||
|
DumpExtension::class => autowire(DumpExtension::class),
|
||||||
|
];
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Dump\Picea;
|
||||||
|
|
||||||
|
use Picea\{ Extension\Extension, Extension\FunctionExtension };
|
||||||
|
|
||||||
|
class DumpExtension implements Extension {
|
||||||
|
|
||||||
|
public array $token = [ "dump" ];
|
||||||
|
|
||||||
|
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token, array $options = []) : string
|
||||||
|
{
|
||||||
|
return "<?php \dump($arguments) ?>";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue