From eba2c032a808aa5631fec8be249483032dbf745b Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 20 Mar 2014 19:54:52 -0400 Subject: [PATCH] DI WIP --- Mailer.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mailer.php b/Mailer.php index 1f91f6d..353a7fc 100644 --- a/Mailer.php +++ b/Mailer.php @@ -200,10 +200,9 @@ class Mailer extends BaseMailer } } unset($config['constructArgs']); - array_unshift($args, $className); - $object = call_user_func_array(['Yii', 'createObject'], $args); + $object = Yii::createObject($className, $args); } else { - $object = new $className; + $object = Yii::createObject($className); } if (!empty($config)) { foreach ($config as $name => $value) {