Remove setter from CompileCommand

Also, let the Compiler be constructed with DI or by itself
This commit is contained in:
Jakub Turek
2015-03-08 21:21:49 +01:00
parent 5e51b79857
commit 3b326227ae
2 changed files with 23 additions and 28 deletions
+4 -5
View File
@@ -26,13 +26,12 @@ class CompileCommand extends AbstractCommand
*/
private $compiler;
public function __construct()
public function __construct(Compiler $compiler = null)
{
$this->setCompiler(new Compiler());
}
if ($compiler === null) {
$compiler = new Compiler();
}
public function setCompiler(Compiler $compiler)
{
$this->compiler = $compiler;
}