From bbadaa13005199b413f0a62dd5deea9c10db26e1 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Tue, 3 Jan 2023 10:47:33 +0100 Subject: [PATCH] add shorthand function to get DI handler --- autoload/functions_oxDIC.php | 25 +++++++++++++++++++++++++ composer.json | 5 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 autoload/functions_oxDIC.php diff --git a/autoload/functions_oxDIC.php b/autoload/functions_oxDIC.php new file mode 100644 index 0000000..dce0f68 --- /dev/null +++ b/autoload/functions_oxDIC.php @@ -0,0 +1,25 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +use D3\DIContainerHandler\d3DicHandler; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * @return ContainerBuilder + */ +function d3GetOxidDIC(): ContainerBuilder +{ + return d3DicHandler::getInstance(); +} diff --git a/composer.json b/composer.json index ef3cd3a..16a96e1 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,9 @@ "autoload": { "psr-4": { "D3\\DIContainerHandler\\": "./" - } + }, + "files": [ + "autoload/functions_oxDIC.php" + ] } }