77 *
88 * @license MIT License
99 */
10-
1110namespace Propel \PropelBundle \Command ;
1211
1312use Symfony \Component \Console \Input \InputInterface ;
1413use Symfony \Component \Console \Input \InputOption ;
1514use Symfony \Component \Console \Output \OutputInterface ;
16- use Symfony \Component \Console \Output \Output ;
1715use Symfony \Component \Filesystem \Filesystem ;
1816use Symfony \Component \Finder \Finder ;
1917
20- use Propel \PropelBundle \Command \AbstractCommand ;
21-
2218/**
2319 * SqlBuildCommand.
2420 *
@@ -55,14 +51,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
5551 $ finder = new Finder ();
5652 $ filesystem = new Filesystem ();
5753
58- $ sqlDir = $ this ->getApplication ()->getKernel ()->getCacheDir (). DIRECTORY_SEPARATOR .'propel ' .DIRECTORY_SEPARATOR . 'sql ' ;
54+ $ sqlDir = $ this ->getApplication ()->getKernel ()->getCacheDir ().DIRECTORY_SEPARATOR .'propel ' .DIRECTORY_SEPARATOR .'sql ' ;
5955
6056 $ filesystem ->remove ($ sqlDir );
6157 $ filesystem ->mkdir ($ sqlDir );
6258
6359 // Execute the task
6460 $ ret = $ this ->callPhing ('build-sql ' , array (
65- 'propel.sql.dir ' => $ sqlDir
61+ 'propel.sql.dir ' => $ sqlDir,
6662 ));
6763
6864 // Show the list of generated files
@@ -72,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7268 $ nbFiles = 0 ;
7369 foreach ($ files as $ file ) {
7470 $ fileExt = pathinfo ($ file ->getFilename (), PATHINFO_EXTENSION );
75- $ finalLocation = $ sqlDir . DIRECTORY_SEPARATOR . $ file ->getFilename ();
71+ $ finalLocation = $ sqlDir .DIRECTORY_SEPARATOR .$ file ->getFilename ();
7672
7773 if ($ fileExt === 'map ' && $ filesystem ->exists ($ finalLocation )) {
7874 $ this ->mergeMapFiles ($ finalLocation , (string ) $ file );
@@ -81,7 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8177 $ this ->writeNewFile ($ output , (string ) $ file );
8278
8379 if ('sql ' === $ fileExt ) {
84- $ nbFiles ++ ;
80+ ++ $ nbFiles ;
8581 }
8682 }
8783
@@ -92,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9288 $ this ->writeSection ($ output , array (
9389 '[Propel] Error ' ,
9490 '' ,
95- 'An error has occured during the "propel:sql:build" command process. To get more details, run the command with the "--verbose" option. '
91+ 'An error has occured during the "propel:sql:build" command process. To get more details, run the command with the "--verbose" option. ' ,
9692 ), 'fg=white;bg=red ' );
9793 }
9894 }
@@ -104,16 +100,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
104100 * @param string $target target map filename
105101 * @param string $generated generated map filename
106102 *
107- * @return boolean result
103+ * @return bool
108104 */
109105 protected function mergeMapFiles ($ target , $ generated )
110106 {
111- if (($ targetContent = file ($ target )) === false )
112-
107+ if (false === ($ targetContent = file ($ target ))) {
113108 return false ;
114- if (( $ generatedContent = file ( $ generated )) === false )
109+ }
115110
111+ if (false === ($ generatedContent = file ($ generated ))) {
116112 return false ;
113+ }
117114
118115 $ targetContent = array_merge ($ generatedContent , array_diff ($ targetContent , $ generatedContent ));
119116
0 commit comments