dev #9
28
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power
Normal file
28
src/202ccd9e-dfcf-4cde-a0ce-bde1fd27f088/code.power
Normal 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')
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user