From 804deb69a27f6098b4dcc1122be135078a9f9582 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 15 Nov 2023 22:12:47 -0500 Subject: [PATCH] - Added PPH-DI definition file --- composer.json | 9 +++++++++ meta/definitions.php | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 meta/definitions.php diff --git a/composer.json b/composer.json index 9512201..c5ffa71 100644 --- a/composer.json +++ b/composer.json @@ -22,5 +22,14 @@ "psr-4": { "Picea\\Ui\\": "src/" } + }, + "extra": { + "lean": { + "autoload": { + "definitions": [ + "meta/definitions.php" + ] + } + } } } diff --git a/meta/definitions.php b/meta/definitions.php new file mode 100644 index 0000000..7d042f7 --- /dev/null +++ b/meta/definitions.php @@ -0,0 +1,27 @@ + autowire(Ui::class), + + 'picea.extensions' => function(\Psr\Container\ContainerInterface $c) { + return 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()) + ); + }, +]; \ No newline at end of file