Compare commits
3 Commits
42d84796ee
...
043fb90f8d
Author | SHA1 | Date | |
---|---|---|---|
043fb90f8d | |||
d5de5e665b | |||
3ccbf6bfab |
@ -10,7 +10,7 @@ use function DI\autowire, DI\create, DI\get;
|
|||||||
use Laminas\Diactoros\Response\HtmlResponse;
|
use Laminas\Diactoros\Response\HtmlResponse;
|
||||||
|
|
||||||
use Picea\{ Picea, Caching\Cache, Caching\Opcache, Compiler, Compiler\Context, Compiler\BaseContext, FileFetcher, Language\DefaultRegistrations, Method\Request };
|
use Picea\{ Picea, Caching\Cache, Caching\Opcache, Compiler, Compiler\Context, Compiler\BaseContext, FileFetcher, Language\DefaultRegistrations, Method\Request };
|
||||||
use Picea\Extension\{ LanguageHandler, LanguageExtension, TitleExtension, NumberExtension, UrlExtension };
|
use Picea\Extension\{ LanguageHandlerInterface, LanguageExtension, TitleExtension, NumberExtension, UrlExtension };
|
||||||
use Picea\Ui\{ Method, Ui };
|
use Picea\Ui\{ Method, Ui };
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@ -49,10 +49,10 @@ return [
|
|||||||
|
|
||||||
Method\Pagination::class => autowire(Method\Pagination::class),
|
Method\Pagination::class => autowire(Method\Pagination::class),
|
||||||
|
|
||||||
LanguageExtension::class => create(LanguageExtension::class)->constructor(get(LanguageHandler::class)),
|
LanguageExtension::class => create(LanguageExtension::class)->constructor(get(LanguageHandlerInterface::class)),
|
||||||
|
|
||||||
LanguageHandler::class => function($c) {
|
LanguageHandlerInterface::class => function($c) {
|
||||||
return new class( $c->get(Tell\I18n::class) ) implements LanguageHandler {
|
return new class( $c->get(Tell\I18n::class) ) implements LanguageHandlerInterface {
|
||||||
public Tell\I18n $tell;
|
public Tell\I18n $tell;
|
||||||
|
|
||||||
public function __construct(Tell\I18n $tell) {
|
public function __construct(Tell\I18n $tell) {
|
||||||
|
@ -50,15 +50,21 @@ if (! class_exists("%NAMESPACE%\%CLASSNAME%", false) ) {
|
|||||||
|
|
||||||
$__event->eventExecute(\Picea\Event\Builder\ClassTemplateOutputing::class, $variablesList);
|
$__event->eventExecute(\Picea\Event\Builder\ClassTemplateOutputing::class, $variablesList);
|
||||||
|
|
||||||
|
try {
|
||||||
( function($___class__template, $___global_variables, $___variables, $__event, $picea) {
|
( function($___class__template, $___global_variables, $___variables, $__event, $picea) {
|
||||||
extract($___global_variables);
|
extract($___global_variables);
|
||||||
extract($___variables, \EXTR_OVERWRITE);
|
extract($___variables, \EXTR_OVERWRITE);
|
||||||
?>%CONTENT%<?php
|
?>%CONTENT%<?php
|
||||||
} )->call($this->thisProxy ?? new class() {}, $this, $this->variableList, $variablesList, $__event, $this->picea);
|
} )->call($this->thisProxy ?? new class() {}, $this, $this->variableList, $variablesList, $__event, $this->picea);
|
||||||
|
} catch (\Throwable $error) {
|
||||||
|
throw $this->errorHandler($error);
|
||||||
|
}
|
||||||
|
|
||||||
$__event->eventExecute(\Picea\Event\Builder\ClassTemplateOutputDone::class, $variablesList);
|
$__event->eventExecute(\Picea\Event\Builder\ClassTemplateOutputDone::class, $variablesList);
|
||||||
|
|
||||||
%PARENT_OUTPUT%
|
try { %PARENT_OUTPUT% } catch (\Throwable $error) {
|
||||||
|
throw $this->errorHandler($error);
|
||||||
|
}
|
||||||
|
|
||||||
$this->depth--;
|
$this->depth--;
|
||||||
|
|
||||||
@ -138,6 +144,32 @@ if (! class_exists("%NAMESPACE%\%CLASSNAME%", false) ) {
|
|||||||
$this->output($variablesList);
|
$this->output($variablesList);
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isTemplateError(\Throwable $error) : bool
|
||||||
|
{
|
||||||
|
$class = substr(static::class, strripos(static::class, '\\') + 1) . ".php";
|
||||||
|
|
||||||
|
return substr($error->getFile(), -strlen($class)) === $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function errorHandler(\Throwable $error) : \Throwable
|
||||||
|
{
|
||||||
|
$class = substr(static::class, strrpos(static::class, '\\') + 1) . ".php";
|
||||||
|
|
||||||
|
#dump( __NAMESPACE__, basename($error->getFile()), $class );
|
||||||
|
$basename = basename($error->getFile());
|
||||||
|
|
||||||
|
#dump(is_subclass_of(sprintf("\\%s\\%s", __NAMESPACE__, substr($basename,0 , strrpos($basename, '.'))), static::class, true));
|
||||||
|
|
||||||
|
if (str_ends_with($error->getFile(), $class)) {
|
||||||
|
$error = new \Picea\Exception\RenderHtmlException($this, $error->getMessage(), $error->getCode(), $error);
|
||||||
|
}
|
||||||
|
#elseif (is_subclass_of(sprintf("\\%s\\%s", __NAMESPACE__, substr($basename,0 , strrpos($basename, '.'))), static::class, true)) {
|
||||||
|
# $error = new \Picea\Exception\RenderHtmlException($this, $error->getMessage(), $error->getCode(), $error);
|
||||||
|
#}
|
||||||
|
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
namespace Picea;
|
namespace Picea;
|
||||||
|
|
||||||
|
use Picea\Event\Compiler\CompileTokenExtension;
|
||||||
|
use Picea\Event\Compiler\CompileTokenExtensionEvent;
|
||||||
|
use Picea\Event\Compiler\CompileTokenTagEvent;
|
||||||
use Picea\Exception\RegisterExtensionToken;
|
use Picea\Exception\RegisterExtensionToken;
|
||||||
use Picea\Extension\FunctionExtension;
|
use Picea\Extension\FunctionExtension;
|
||||||
use Picea\Language\LanguageRegistration;
|
use Picea\Language\LanguageRegistration;
|
||||||
|
|
||||||
class Compiler
|
class Compiler
|
||||||
{
|
{
|
||||||
|
use EventTrait;
|
||||||
|
|
||||||
protected string $sourceCode = "";
|
protected string $sourceCode = "";
|
||||||
|
|
||||||
protected array $syntaxObjectList = [];
|
protected array $syntaxObjectList = [];
|
||||||
@ -20,11 +25,10 @@ class Compiler
|
|||||||
|
|
||||||
public array $extensionList = [];
|
public array $extensionList = [];
|
||||||
|
|
||||||
public ? LanguageRegistration $languageRegistration;
|
public function __construct(
|
||||||
|
public LanguageRegistration $languageRegistration
|
||||||
public function __construct(?LanguageRegistration $languageRegistration = null)
|
)
|
||||||
{
|
{
|
||||||
$this->languageRegistration = $languageRegistration;
|
|
||||||
$this->languageRegistration->registerAll($this);
|
$this->languageRegistration->registerAll($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +57,14 @@ class Compiler
|
|||||||
$tokenName = $context->tokenName($token);
|
$tokenName = $context->tokenName($token);
|
||||||
$tokenOptions = $context->tokenOptions($token);
|
$tokenOptions = $context->tokenOptions($token);
|
||||||
|
|
||||||
# @TODO Refractor this parts to allows registration to the tag's name
|
|
||||||
if ( $this->tagList[$tokenName] ?? false ) {
|
if ( $this->tagList[$tokenName] ?? false ) {
|
||||||
|
$this->eventExecute(CompileTokenTagEvent::class, $context, $arguments, $tokenName, $tokenOptions);
|
||||||
|
|
||||||
return $this->tagList[$tokenName]->parse($context, $arguments, $tokenName, $tokenOptions);
|
return $this->tagList[$tokenName]->parse($context, $arguments, $tokenName, $tokenOptions);
|
||||||
}
|
}
|
||||||
elseif ( $this->extensionList[$tokenName] ?? false ) {
|
elseif ( $this->extensionList[$tokenName] ?? false ) {
|
||||||
|
$this->eventExecute(CompileTokenExtensionEvent::class, $context, $arguments, $tokenName, $tokenOptions);
|
||||||
|
|
||||||
return $this->extensionList[$tokenName]->parse($context, $arguments, $tokenName, $tokenOptions);
|
return $this->extensionList[$tokenName]->parse($context, $arguments, $tokenName, $tokenOptions);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -135,7 +142,7 @@ class Compiler
|
|||||||
|
|
||||||
public function __toString() : string
|
public function __toString() : string
|
||||||
{
|
{
|
||||||
return "WHATAFAK";
|
return "???";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExtensionFromToken(string $name) : Extension\Extension
|
public function getExtensionFromToken(string $name) : Extension\Extension
|
||||||
|
@ -63,9 +63,9 @@ class SectionToken implements ControlStructure {
|
|||||||
$order = $options['order'] ?? "count(\$___class__template->sectionList[$name]['$action'])";
|
$order = $options['order'] ?? "count(\$___class__template->sectionList[$name]['$action'])";
|
||||||
|
|
||||||
return "<?php \$___class__template->sectionList[$name] ??= [ 'prepend' => [], 'append' => [], 'default' => [] ];" .
|
return "<?php \$___class__template->sectionList[$name] ??= [ 'prepend' => [], 'append' => [], 'default' => [] ];" .
|
||||||
"\$___class__template->sectionList[$name]['$action'][] = [
|
"\$___class__template->sectionList[$name]['$action'][] = [ ".
|
||||||
'order' => $order,
|
"'order' => $order, " .
|
||||||
'callback' => function() use (\$picea, \$___class__template, \$___global_variables, \$___variables, \$__event) {" .
|
"'callback' => function() use (\$picea, \$___class__template, \$___global_variables, \$___variables, \$__event) {" .
|
||||||
"extract(\$___global_variables); extract(\$___variables, \EXTR_OVERWRITE);" .
|
"extract(\$___global_variables); extract(\$___variables, \EXTR_OVERWRITE);" .
|
||||||
"\$___class__template->sectionStack[] = $name;" .
|
"\$___class__template->sectionStack[] = $name;" .
|
||||||
"\$__event->eventExecute(\Picea\Event\Builder\ClassTemplateRenderSection::class, $name);?>";
|
"\$__event->eventExecute(\Picea\Event\Builder\ClassTemplateRenderSection::class, $name);?>";
|
||||||
|
10
src/Event/Compiler/CompileTokenExtensionEvent.php
Normal file
10
src/Event/Compiler/CompileTokenExtensionEvent.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Compiler;
|
||||||
|
|
||||||
|
use Picea\Compiler\Context;
|
||||||
|
|
||||||
|
interface CompileTokenExtensionEvent
|
||||||
|
{
|
||||||
|
public function execute(Context $context, ?string $arguments, string $token, array $options = []);
|
||||||
|
}
|
10
src/Event/Compiler/CompileTokenTagEvent.php
Normal file
10
src/Event/Compiler/CompileTokenTagEvent.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Compiler;
|
||||||
|
|
||||||
|
use Picea\Compiler\Context;
|
||||||
|
|
||||||
|
interface CompileTokenTagEvent
|
||||||
|
{
|
||||||
|
public function execute(Context &$context, ?string $arguments, string $token, array $options = []);
|
||||||
|
}
|
8
src/Event/Extension/UrlBuildAssetEvent.php
Normal file
8
src/Event/Extension/UrlBuildAssetEvent.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Extension;
|
||||||
|
|
||||||
|
interface UrlBuildAssetEvent
|
||||||
|
{
|
||||||
|
public function execute(string $uri, array $parameters = [], bool $appendVersion) : void;
|
||||||
|
}
|
8
src/Event/Extension/UrlBuildRouteEvent.php
Normal file
8
src/Event/Extension/UrlBuildRouteEvent.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Extension;
|
||||||
|
|
||||||
|
interface UrlBuildRouteEvent
|
||||||
|
{
|
||||||
|
public function execute(string $uri, array $parameters = [], bool $appendVersion) : void;
|
||||||
|
}
|
8
src/Event/Extension/UrlBuildUrlEvent.php
Normal file
8
src/Event/Extension/UrlBuildUrlEvent.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Extension;
|
||||||
|
|
||||||
|
interface UrlBuildUrlEvent
|
||||||
|
{
|
||||||
|
public function execute(string $uri, array $parameters = [], bool $appendVersion) : void;
|
||||||
|
}
|
8
src/Event/Extension/UrlRegisterRouteEvent.php
Normal file
8
src/Event/Extension/UrlRegisterRouteEvent.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Picea\Event\Extension;
|
||||||
|
|
||||||
|
interface UrlRegisterRouteEvent
|
||||||
|
{
|
||||||
|
public function execute(string $name, array $route) : void;
|
||||||
|
}
|
@ -4,26 +4,26 @@ namespace Picea;
|
|||||||
|
|
||||||
trait EventTrait
|
trait EventTrait
|
||||||
{
|
{
|
||||||
protected $_eventTraitMethod = "execute";
|
protected $eventTraitMethod = "execute";
|
||||||
|
|
||||||
public array $_eventList = [];
|
public array $eventTraitList = [];
|
||||||
|
|
||||||
protected array $_returnList = [];
|
protected array $eventTraitReturnList = [];
|
||||||
|
|
||||||
public function eventRegister(object $event) : void
|
public function eventRegister(object $event) : void
|
||||||
{
|
{
|
||||||
$this->_eventList[] = $event;
|
$this->eventTraitList[] = $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function eventFromType(string $type) : array
|
public function eventFromType(string $type) : array
|
||||||
{
|
{
|
||||||
return array_filter($this->_eventList, fn($ev) => $ev instanceof $type);
|
return array_filter($this->eventTraitList, fn($ev) => $ev instanceof $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function eventExecute(string $type, ...$arguments) : void
|
public function eventExecute(string $type, ...$arguments) : void
|
||||||
{
|
{
|
||||||
foreach($this->eventFromType($type) as $event) {
|
foreach($this->eventFromType($type) as $event) {
|
||||||
$this->_returnList[$event::class][] = call_user_func_array([ $event, $this->_eventTraitMethod ], $arguments);
|
$this->eventTraitReturnList[$event::class][] = call_user_func_array([ $event, $this->eventTraitMethod ], $arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,33 +10,20 @@ use Picea\Picea;
|
|||||||
*/
|
*/
|
||||||
class RenderHtmlException extends \Exception
|
class RenderHtmlException extends \Exception
|
||||||
{
|
{
|
||||||
protected Picea $picea;
|
|
||||||
|
|
||||||
public function __construct(object $compiledObject, Picea $picea, string $message, int $code, \Throwable $previous)
|
public function __construct(object $template, string $message, int $code, \Throwable $previous)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
|
|
||||||
$this->picea = $picea;
|
$this->defineError($previous, $template);
|
||||||
|
|
||||||
$this->defineError($previous, $compiledObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function defineError(\Throwable $previous, object $compiledObject) : void
|
protected function defineError(\Throwable $previous, object $template) : void
|
||||||
{
|
{
|
||||||
$loadedTemplates = array_flip($this->picea->loadedTemplateFile);
|
/*$loadedTemplates = array_flip($this->picea->loadedTemplateFile);*/
|
||||||
|
|
||||||
foreach($previous->getTrace() as $trace) {
|
$this->file = $template::getParam('view');
|
||||||
if ( isset($trace['file'], $loadedTemplates[$trace['file']]) ) {
|
$this->line = $template::getSourceLineFromException($previous->getLine());
|
||||||
$class = $loadedTemplates[ $trace['file'] ];
|
|
||||||
|
|
||||||
$content = include($trace['file']);
|
|
||||||
|
|
||||||
$this->file = $content['view'];
|
|
||||||
$this->line = $class::getSourceLineFromException($trace['line']);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTemplateFile(string $filePath) : ? array
|
protected function getTemplateFile(string $filePath) : ? array
|
||||||
|
@ -11,9 +11,9 @@ class LanguageExtension implements Extension, FunctionExtension {
|
|||||||
|
|
||||||
public string $currentLanguage = "";
|
public string $currentLanguage = "";
|
||||||
|
|
||||||
protected LanguageHandler $languageHandler;
|
protected LanguageHandlerInterface $languageHandler;
|
||||||
|
|
||||||
public function __construct(LanguageHandler $handler) {
|
public function __construct(LanguageHandlerInterface $handler) {
|
||||||
$this->languageHandler = $handler;
|
$this->languageHandler = $handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Picea\Extension;
|
namespace Picea\Extension;
|
||||||
|
|
||||||
interface LanguageHandler
|
interface LanguageHandlerInterface
|
||||||
{
|
{
|
||||||
public function languageFromKey(string $key, array $variables = []); #: array|string;
|
public function languageFromKey(string $key, array $variables = []); #: array|string;
|
||||||
}
|
}
|
@ -17,13 +17,10 @@ class TitleExtension implements Extension, FunctionExtension {
|
|||||||
|
|
||||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token, array $options = []) : string
|
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token, array $options = []) : string
|
||||||
{
|
{
|
||||||
return <<<PHP
|
return "<?php ".
|
||||||
<?php
|
"if ( null !== \$title = title($arguments) ) {".
|
||||||
if ( null !== \$title = title($arguments) ) {
|
"echo \$title;".
|
||||||
echo \$title;
|
"} ?>";
|
||||||
}
|
|
||||||
?>
|
|
||||||
PHP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleTitle(? string $set = null, ...$arguments) : ? string
|
public function handleTitle(? string $set = null, ...$arguments) : ? string
|
||||||
|
@ -3,9 +3,15 @@
|
|||||||
namespace Picea\Extension;
|
namespace Picea\Extension;
|
||||||
|
|
||||||
use Notes\Route\Attribute\Object\Route;
|
use Notes\Route\Attribute\Object\Route;
|
||||||
|
use Picea\EventTrait;
|
||||||
use Picea\Compiler\Context;
|
use Picea\Compiler\Context;
|
||||||
|
|
||||||
|
use Picea\Event\Extension\{ UrlBuildAssetEvent, UrlBuildUrlEvent, UrlBuildRouteEvent, UrlRegisterRouteEvent };
|
||||||
|
|
||||||
class UrlExtension implements Extension, FunctionExtension {
|
class UrlExtension implements Extension, FunctionExtension {
|
||||||
|
use \Picea\EventTrait;
|
||||||
|
|
||||||
|
use EventTrait;
|
||||||
|
|
||||||
public const URLIZE_PATTERN_URL = <<<PATTERN
|
public const URLIZE_PATTERN_URL = <<<PATTERN
|
||||||
~(?<!href=['"])https?://[\w/._\-&?]*(?!</a>)(?=[^\w/._\-&])~s
|
~(?<!href=['"])https?://[\w/._\-&?]*(?!</a>)(?=[^\w/._\-&])~s
|
||||||
@ -105,11 +111,15 @@ PATTERN;
|
|||||||
|
|
||||||
public function buildUrl(string $uri = "", array $parameters = [], bool $appendVersion = false) : string
|
public function buildUrl(string $uri = "", array $parameters = [], bool $appendVersion = false) : string
|
||||||
{
|
{
|
||||||
|
$this->eventExecute(UrlBuildUrlEvent::class, $uri, $parameters, $appendVersion);
|
||||||
|
|
||||||
return $this->setUrlParameters($this->url() . "/" . ltrim($uri, "/"), $appendVersion ? array_replace([ 'v' => $this->assetToken ], $parameters) : $parameters);
|
return $this->setUrlParameters($this->url() . "/" . ltrim($uri, "/"), $appendVersion ? array_replace([ 'v' => $this->assetToken ], $parameters) : $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildAssetUrl(string $uri, array $parameters = [], bool $appendVersion = true) : string
|
public function buildAssetUrl(string $uri, array $parameters = [], bool $appendVersion = true) : string
|
||||||
{
|
{
|
||||||
|
$this->eventExecute(UrlBuildAssetEvent::class, $uri, $parameters, $appendVersion);
|
||||||
|
|
||||||
return $this->buildUrl($uri, $parameters, $appendVersion);
|
return $this->buildUrl($uri, $parameters, $appendVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,6 +160,8 @@ PATTERN;
|
|||||||
'class' => $class,
|
'class' => $class,
|
||||||
'classMethod' => $method,
|
'classMethod' => $method,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$this->eventExecute(UrlRegisterRouteEvent::class, $name, $this->routes[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -274,7 +286,6 @@ PATTERN;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$search[$item[0]] = $value ?? "";
|
$search[$item[0]] = $value ?? "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$route = str_replace(array_keys($search), array_values($search), $route);
|
$route = str_replace(array_keys($search), array_values($search), $route);
|
||||||
|
@ -6,18 +6,11 @@ use Picea\Compiler;
|
|||||||
|
|
||||||
class DefaultRegistrations implements LanguageRegistration
|
class DefaultRegistrations implements LanguageRegistration
|
||||||
{
|
{
|
||||||
protected array $extensions;
|
public function __construct(
|
||||||
|
protected array $extensions,
|
||||||
protected array $syntaxes;
|
protected array $syntaxes,
|
||||||
|
protected array $controlStructures,
|
||||||
protected array $controlStructures;
|
) { }
|
||||||
|
|
||||||
public function __construct(array $extensions = [], array $syntaxes = [], array $controlStructure = [])
|
|
||||||
{
|
|
||||||
$this->extensions = $extensions;
|
|
||||||
$this->syntaxes = $syntaxes;
|
|
||||||
$this->controlStructures = $controlStructure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function registerAll(Compiler $compiler) : void
|
public function registerAll(Compiler $compiler) : void
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ class Picea implements LanguageRegistration
|
|||||||
){
|
){
|
||||||
$this->cache = $cache ?? new Caching\Memory("");
|
$this->cache = $cache ?? new Caching\Memory("");
|
||||||
$this->context = $context ?? new Compiler\BaseContext();
|
$this->context = $context ?? new Compiler\BaseContext();
|
||||||
$this->languageRegistration = $languageRegistration ?? new Language\DefaultRegistrations();
|
$this->languageRegistration = $languageRegistration ?? new Language\DefaultRegistrations([], [], []);
|
||||||
$this->builderTemplatePath = $builderTemplatePath ?? dirname(__FILE__) . static::DEFAULT_BUILDER_TEMPLATE;
|
$this->builderTemplatePath = $builderTemplatePath ?? dirname(__FILE__) . static::DEFAULT_BUILDER_TEMPLATE;
|
||||||
$this->compiler = $compiler ?? $this->instanciateCompiler();
|
$this->compiler = $compiler ?? $this->instanciateCompiler();
|
||||||
$this->fileFetcher = $fileFetcher ?? $this->instanciateFileFetcher();
|
$this->fileFetcher = $fileFetcher ?? $this->instanciateFileFetcher();
|
||||||
@ -79,7 +79,7 @@ class Picea implements LanguageRegistration
|
|||||||
#}
|
#}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user