/** * @return CompilerInterface|null */ public function getMinifier() { if (!$this->minifier instanceof CompilerInterface) { switch (true) { case is_array($this->minifier): $this->minifier = CompilerFactory::factory($this->minifier); break; case $this->minifier == null: $this->minifier = CompilerFactory::factory('unify'); break; default: } } return $this->minifier; }
/** * @param string $pp * @return array|CompilerInterface */ public function getPreprocessor($pp = 'Unify') { if (!$this->preprocessor instanceof CompilerInterface) { switch (true) { case is_array($this->preprocessor): $this->preprocessor['compiler'] = array('tool' => '\\Netis\\Code\\Css\\Compiler\\' . ucfirst($pp)); $this->preprocessor = CompilerFactory::factory($this->preprocessor); break; case $this->preprocessor == null: $this->preprocessor = new Unify(); break; default: } } return $this->preprocessor; }
public function setUp() { $this->compile = CompilerFactory::factory(array('tool' => 'minify', 'code' => 'js')); }
/** * @expectedException \Athem\Exception\InvalidResource */ public function testCompilerExceptionNoCacheDefined() { $this->compiler = CompilerFactory::factory(array('tool' => '\\Athcore\\Code\\CachedCompiler', 'minifier' => array('tool' => 'unify'))); }
public function testJs() { $this->assertTrue(Code\CompilerFactory::factory(array('tool' => 'yui', 'code' => 'js')) instanceof Code\Js\Compiler\Yui); $this->assertTrue(Code\CompilerFactory::factory(array('tool' => 'minify', 'code' => 'js')) instanceof Code\Js\Compiler\Minify); }
public function setUp() { $this->compile = CompilerFactory::factory(array('tool' => 'yui', 'code' => 'css')); }