@@ -66,34 +66,44 @@ public function filterLoad(AssetInterface $asset)
6666 */
6767 protected function compress ($ content , $ type , $ options = array ())
6868 {
69- $ pb = $ this ->createProcessBuilder (array ($ this ->javaPath ));
69+ $ arguments = [
70+ $ this ->javaPath
71+ ];
7072
7173 if (null !== $ this ->stackSize ) {
72- $ pb -> add ( '-Xss ' .$ this ->stackSize ) ;
74+ $ arguments [] = '-Xss ' .$ this ->stackSize ;
7375 }
7476
75- $ pb ->add ('-jar ' )->add ($ this ->jarPath );
77+ $ arguments [] = '-jar ' ;
78+ $ arguments [] = $ this ->jarPath ;
7679
7780 foreach ($ options as $ option ) {
78- $ pb -> add ( $ option) ;
81+ $ arguments [] = $ option ;
7982 }
8083
8184 if (null !== $ this ->charset ) {
82- $ pb ->add ('--charset ' )->add ($ this ->charset );
85+ $ arguments [] = '--charset ' ;
86+ $ arguments [] = $ this ->charset ;
8387 }
8488
8589 if (null !== $ this ->lineBreak ) {
86- $ pb ->add ('--line-break ' )->add ($ this ->lineBreak );
90+ $ arguments [] = '--line-break ' ;
91+ $ arguments [] = $ this ->lineBreak ;
8792 }
8893
8994 // input and output files
9095 $ tempDir = FilesystemUtils::getTemporaryDirectory ();
9196 $ input = tempnam ($ tempDir , 'assetic_yui_input ' );
9297 $ output = tempnam ($ tempDir , 'assetic_yui_output ' );
9398 file_put_contents ($ input , $ content );
94- $ pb ->add ('-o ' )->add ($ output )->add ('--type ' )->add ($ type )->add ($ input );
9599
96- $ proc = $ pb ->getProcess ();
100+ $ arguments [] = '-o ' ;
101+ $ arguments [] = $ output ;
102+ $ arguments [] = '--type ' ;
103+ $ arguments [] = $ type ;
104+ $ arguments [] = $ input ;
105+
106+ $ proc = $ this ->createProcessBuilder ($ arguments );
97107 $ code = $ proc ->run ();
98108 unlink ($ input );
99109
0 commit comments