From 5aedc965ce19a64195debe27214c0fb686eaa790 Mon Sep 17 00:00:00 2001 From: Llewellyn Date: Wed, 11 Sep 2024 02:39:20 +0000 Subject: [PATCH] Create JCB.File.Service.File code --- .../code.power | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power diff --git a/src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power b/src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power new file mode 100644 index 0000000..0b1aed5 --- /dev/null +++ b/src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power @@ -0,0 +1,28 @@ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 5.0.3 + */ + public function register(Container $container) + { + $container->alias(FileType::class, 'File.Type') + ->share('File.Type', [$this, 'getFileType'], true); + } + + /** + * Get The File Type Class. + * + * @param Container $container The DI container. + * + * @return FileType + * @since 5.0.3 + */ + public function getFileType(Container $container): FileType + { + return new FileType( + $container->get('Data.Item') + ); + } \ No newline at end of file