CLI
This commit is contained in:
20
cli/common/Alias/Application.php
Normal file
20
cli/common/Alias/Application.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Alias;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symfony\Component\Console\Application as Base;
|
||||
|
||||
class Application extends Base
|
||||
{
|
||||
public function __construct(protected ContainerInterface $container, string $name = 'UNKNOWN', string $version = 'UNKNOWN')
|
||||
{
|
||||
if ($this->container->has('APP_NAME')) {
|
||||
$name = $this->container->get('APP_NAME');
|
||||
}
|
||||
parent::__construct($name, $version);
|
||||
}
|
||||
public function getContainer(): ContainerInterface
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user