Skip to content

Commit

Permalink
Adopt configs to new factory syntax (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
  • Loading branch information
vjik and samdark committed Apr 13, 2021
1 parent bc21aad commit cc93532
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions config/console.php
Expand Up @@ -4,7 +4,7 @@

use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Symfony\Component\Console\Input\InputOption;
use Yiisoft\Factory\Definitions\Reference;
use Yiisoft\Factory\Definition\Reference;
use Yiisoft\Yii\Console\Application;
use Yiisoft\Yii\Console\CommandLoader;
use Yiisoft\Yii\Console\SymfonyEventDispatcher;
Expand All @@ -13,14 +13,14 @@

return [
CommandLoaderInterface::class => [
'__class' => CommandLoader::class,
'class' => CommandLoader::class,
'__construct()' => [
'commandMap' => $params['yiisoft/yii-console']['commands'],
],
],

Application::class => [
'__class' => Application::class,
'class' => Application::class,
'setDispatcher()' => [Reference::to(SymfonyEventDispatcher::class)],
'setCommandLoader()' => [Reference::to(CommandLoaderInterface::class)],
'addOptions()' => [
Expand Down
20 changes: 11 additions & 9 deletions tests/TestCase.php
Expand Up @@ -15,7 +15,7 @@
use Yiisoft\Di\Container;
use Yiisoft\EventDispatcher\Dispatcher\Dispatcher;
use Yiisoft\EventDispatcher\Provider\Provider;
use Yiisoft\Factory\Definitions\Reference;
use Yiisoft\Factory\Definition\Reference;
use Yiisoft\Yii\Console\Application;
use Yiisoft\Yii\Console\Command\Serve;
use Yiisoft\Yii\Console\CommandLoader;
Expand Down Expand Up @@ -84,22 +84,24 @@ private function config(): array
EventDispatcherInterface::class => Dispatcher::class,

CommandLoaderInterface::class => [
'__class' => CommandLoader::class,
'class' => CommandLoader::class,
'__construct()' => [
'commandMap' => $params['yiisoft/yii-console']['commands'],
],
],

Application::class => [
'__class' => Application::class,
'class' => Application::class,
'setDispatcher()' => [Reference::to(SymfonyEventDispatcher::class)],
'setCommandLoader()' => [Reference::to(CommandLoaderInterface::class)],
'addOptions()' => [new InputOption(
'config',
'c',
InputOption::VALUE_REQUIRED,
'Set alternative configuration name'
)],
'addOptions()' => [
new InputOption(
'config',
'c',
InputOption::VALUE_REQUIRED,
'Set alternative configuration name'
),
],
'setName()' => [$params['yiisoft/yii-console']['name']],
'setVersion()' => [$params['yiisoft/yii-console']['version']],
'setAutoExit()' => [$params['yiisoft/yii-console']['autoExit']],
Expand Down

0 comments on commit cc93532

Please sign in to comment.