jcb-compiler/src/56ba30f5-a5c4-4c4c-be6f-a56.../code.power

186 lines
5.5 KiB
Plaintext

/**
* Current Joomla Version Being Build
*
* @var int
* @since 3.2.0
**/
protected $targetVersion;
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(AllowAddInterface::class, 'Architecture.Controller.AllowAdd')
->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true);
$container->alias(J5ControllerAllowAdd::class, 'Architecture.Controller.J5.AllowAdd')
->share('Architecture.Controller.J5.AllowAdd', [$this, 'getJ5ControllerAllowAdd'], true);
$container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd')
->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true);
$container->alias(J3ControllerAllowAdd::class, 'Architecture.Controller.J3.AllowAdd')
->share('Architecture.Controller.J3.AllowAdd', [$this, 'getJ3ControllerAllowAdd'], true);
$container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit')
->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true);
$container->alias(J5ControllerAllowEdit::class, 'Architecture.Controller.J5.AllowEdit')
->share('Architecture.Controller.J5.AllowEdit', [$this, 'getJ5ControllerAllowEdit'], true);
$container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit')
->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true);
$container->alias(J3ControllerAllowEdit::class, 'Architecture.Controller.J3.AllowEdit')
->share('Architecture.Controller.J3.AllowEdit', [$this, 'getJ3ControllerAllowEdit'], true);
}
/**
* Get The AllowAddInterface Class.
*
* @param Container $container The DI container.
*
* @return AllowAddInterface
* @since 3.2.0
*/
public function getAllowAdd(Container $container): AllowAddInterface
{
if (empty($this->targetVersion))
{
$this->targetVersion = $container->get('Config')->joomla_version;
}
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd');
}
/**
* Get The AllowAdd Class.
*
* @param Container $container The DI container.
*
* @return J5ControllerAllowAdd
* @since 3.2.0
*/
public function getJ5ControllerAllowAdd(Container $container): J5ControllerAllowAdd
{
return new J5ControllerAllowAdd(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser')
);
}
/**
* Get The AllowAdd Class.
*
* @param Container $container The DI container.
*
* @return J4ControllerAllowAdd
* @since 3.2.0
*/
public function getJ4ControllerAllowAdd(Container $container): J4ControllerAllowAdd
{
return new J4ControllerAllowAdd(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser')
);
}
/**
* Get The AllowAdd Class.
*
* @param Container $container The DI container.
*
* @return J3ControllerAllowAdd
* @since 3.2.0
*/
public function getJ3ControllerAllowAdd(Container $container): J3ControllerAllowAdd
{
return new J3ControllerAllowAdd(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser')
);
}
/**
* Get The AllowEditInterface Class.
*
* @param Container $container The DI container.
*
* @return AllowEditInterface
* @since 3.2.0
*/
public function getAllowEdit(Container $container): AllowEditInterface
{
if (empty($this->targetVersion))
{
$this->targetVersion = $container->get('Config')->joomla_version;
}
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit');
}
/**
* Get The AllowEdit Class.
*
* @param Container $container The DI container.
*
* @return J5ControllerAllowEdit
* @since 3.2.0
*/
public function getJ5ControllerAllowEdit(Container $container): J5ControllerAllowEdit
{
return new J5ControllerAllowEdit(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Category.Other.Name')
);
}
/**
* Get The AllowEdit Class.
*
* @param Container $container The DI container.
*
* @return J4ControllerAllowEdit
* @since 3.2.0
*/
public function getJ4ControllerAllowEdit(Container $container): J4ControllerAllowEdit
{
return new J4ControllerAllowEdit(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Category.Other.Name')
);
}
/**
* Get The AllowEdit Class.
*
* @param Container $container The DI container.
*
* @return J3ControllerAllowEdit
* @since 3.2.0
*/
public function getJ3ControllerAllowEdit(Container $container): J3ControllerAllowEdit
{
return new J3ControllerAllowEdit(
$container->get('Config'),
$container->get('Compiler.Creator.Permission'),
$container->get('Customcode.Dispenser'),
$container->get('Compiler.Builder.Category'),
$container->get('Compiler.Builder.Category.Other.Name')
);
}