Create JCB.File.Service.File code

This commit is contained in:
Llewellyn 2024-09-11 02:39:20 +00:00
parent 2def5c21bf
commit 5aedc965ce

View File

@ -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')
);
}