Browse Source
* Allow DI references in array in dependencies Extremely needed for handler maps and like. Example container config: ``` return [ ContentTypeMiddleware::class => [ '__construct()' => [ Instance::of(StreamFactory::class), [ 'json' => Intance::of(JsonFormatter::class), 'yaml' => Intance::of(YamlFormatter::class), ], ], ], ]; ``` * Add tests for DI references in array in dependencies * Add changelog line * Update CHANGELOG.md Co-authored-by: Alexander Makarov <sam@rmcreative.ru>tags/2.0.36
Alexander Makarov
4 years ago
committed by
GitHub
4 changed files with 62 additions and 0 deletions
@ -0,0 +1,21 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace yiiunit\framework\di\stubs; |
||||
|
||||
use yii\base\BaseObject; |
||||
|
||||
class Corge extends BaseObject |
||||
{ |
||||
public $map; |
||||
|
||||
public function __construct(array $map, $config = []) |
||||
{ |
||||
$this->map = $map; |
||||
parent::__construct($config); |
||||
} |
||||
} |
Loading…
Reference in new issue