arogachev / yii2-excel

ActiveRecord import and export based on PHPExcel for Yii 2 framework
Other
64 stars 25 forks source link

DI refactoring #8

Open arogachev opened 9 years ago

arogachev commented 9 years ago

Here is suggestion from @cyhalothrin:

class Importer {
    public function __construct(ImporterInterface $importer)
    {

    }
}
\Yii::createObject(Importer);

It's better to have ImporterInterface in SL (and information what it implements). Solves passing parameters in constructor and autocomplete problems.