function($c) { return new Picea($c->get(Context::class), $c->get(Cache::class), $c->get(Compiler::class), null, $c->get(FileFetcher::class), null, getenv("DEBUG")); }, Context::class => function($c) { return new BaseContext($c->get(Lean\Lean::class)->getPiceaContext()); }, Compiler::class => function($c) { return new Compiler(new class(array_merge([ $c->get(LanguageExtension::class), $c->get(TitleExtension::class), $c->get(NumberExtension::class), $c->get(UrlExtension::class), $c->get(Method\Form::class), $c->get(Method\Pagination::class), $c->get(Request::class), ], class_exists(\Taxus\Picea\Extension::class) ? [ $c->get(\Taxus\Picea\Extension::class) ] : [], array_map(fn($class) => $c->get($class), $c->get(Lean\Lean::class)->getPiceaExtensions() ))) extends DefaultRegistrations { public function registerAll(Compiler $compiler) : void { parent::registerAll($compiler); if (class_exists(Ui::class)) { ( new Ui() )->registerFormExtension($compiler); } if (class_exists(Asset::class)) { ( new Asset() )->registerExtension($compiler); } } }); }, Request::class => autowire(Request::class), Method\Form::class => autowire(Method\Form::class), Method\Pagination::class => autowire(Method\Pagination::class), LanguageExtension::class => create(LanguageExtension::class)->constructor(get(LanguageHandler::class)), LanguageHandler::class => function($c) { return new class( $c->get(Tell\I18n::class) ) implements LanguageHandler { public Tell\I18n $tell; public function __construct(Tell\I18n $tell) { $this->tell = $tell; } public function languageFromKey(string $key, array $variables = []) #: array|string { return $this->tell->fromKey($key, $variables) ?: ""; } }; }, TitleExtension::class => autowire(TitleExtension::class), NumberExtension::class => autowire(NumberExtension::class), UrlExtension::class => create(UrlExtension::class)->constructor(getenv("URL_BASE"), get('git.commit'), explode(',', getenv('APP_URL')), (bool) getenv('FORCE_SSL')), Cache::class => create(Opcache::class)->constructor(getenv("CACHE_PATH"), get(Context::class)), FileFetcher::class => function($c) { return new FileFetcher($c->get(Lean\Lean::class)->getViewPaths()); }, Action\Install::class => autowire(Action\Install::class), Action\Symlink::class => autowire(Action\Symlink::class), Action\InstallActionInterface::class => create(Action\Symlink::class), ];