public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new ClosureCompilerService();
     }
     return self::$instance;
 }
Example #2
0
 protected function __construct()
 {
     if (isset(self::$instance)) {
         throw new RuntimeException('Instance of AssetDeployer already exists.');
         return;
     }
     $this->ds = DIRECTORY_SEPARATOR;
     $this->deepTraversal = true;
     $this->timestamped = false;
     $this->maxLineLength = 150;
     $this->forceDebug = false;
     $this->mode = self::PROGRESSIVE_ENHANCEMENT;
     $this->store = array();
     $this->closureCompiler = ClosureCompilerService::instance();
     $this->clearScripts();
     $this->cssCompressor = MinifyCssCompressor::instance();
     $this->clearStyles();
 }
 public function testFilterInvalidCodeShouldReturnOriginalContent()
 {
     $filter = new ClosureCompilerService();
     $uncompiled = "function js_1() {";
     $this->assertEquals($uncompiled, trim($filter->filter($uncompiled)));
 }