mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Remove unused code (#11395)
Using `Yii::createObject()` is enough to set config.
This commit is contained in:

committed by
Carsten Brandt

parent
d3fb217dfa
commit
87dd02a077
@ -93,13 +93,7 @@ class BaseMarkdown
|
||||
if (!isset(static::$flavors[$flavor])) {
|
||||
throw new InvalidParamException("Markdown flavor '$flavor' is not defined.'");
|
||||
} elseif (!is_object($config = static::$flavors[$flavor])) {
|
||||
$parser = Yii::createObject($config);
|
||||
if (is_array($config)) {
|
||||
foreach ($config as $name => $value) {
|
||||
$parser->{$name} = $value;
|
||||
}
|
||||
}
|
||||
static::$flavors[$flavor] = $parser;
|
||||
static::$flavors[$flavor] = Yii::createObject($config);
|
||||
}
|
||||
|
||||
return static::$flavors[$flavor];
|
||||
|
Reference in New Issue
Block a user