From fe65d848cab0beff82f15aa8acd5d626e3aa89cb Mon Sep 17 00:00:00 2001 From: Toni Uebernickel Date: Sat, 23 Jan 2016 14:44:00 +0100 Subject: [PATCH] CS fixes --- Command/SqlBuildCommand.php | 23 ++++++++++------------- Command/SqlInsertCommand.php | 2 -- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Command/SqlBuildCommand.php b/Command/SqlBuildCommand.php index 28bdfa7..939a3a1 100644 --- a/Command/SqlBuildCommand.php +++ b/Command/SqlBuildCommand.php @@ -7,18 +7,14 @@ * * @license MIT License */ - namespace Propel\PropelBundle\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\Output; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; -use Propel\PropelBundle\Command\AbstractCommand; - /** * SqlBuildCommand. * @@ -55,14 +51,14 @@ EOT $finder = new Finder(); $filesystem = new Filesystem(); - $sqlDir = $this->getApplication()->getKernel()->getCacheDir(). DIRECTORY_SEPARATOR .'propel'.DIRECTORY_SEPARATOR. 'sql'; + $sqlDir = $this->getApplication()->getKernel()->getCacheDir().DIRECTORY_SEPARATOR.'propel'.DIRECTORY_SEPARATOR.'sql'; $filesystem->remove($sqlDir); $filesystem->mkdir($sqlDir); // Execute the task $ret = $this->callPhing('build-sql', array( - 'propel.sql.dir' => $sqlDir + 'propel.sql.dir' => $sqlDir, )); // Show the list of generated files @@ -72,7 +68,7 @@ EOT $nbFiles = 0; foreach ($files as $file) { $fileExt = pathinfo($file->getFilename(), PATHINFO_EXTENSION); - $finalLocation = $sqlDir. DIRECTORY_SEPARATOR. $file->getFilename(); + $finalLocation = $sqlDir.DIRECTORY_SEPARATOR.$file->getFilename(); if ($fileExt === 'map' && $filesystem->exists($finalLocation)) { $this->mergeMapFiles($finalLocation, (string) $file); @@ -81,7 +77,7 @@ EOT $this->writeNewFile($output, (string) $file); if ('sql' === $fileExt) { - $nbFiles++; + ++$nbFiles; } } @@ -92,7 +88,7 @@ EOT $this->writeSection($output, array( '[Propel] Error', '', - 'An error has occured during the "propel:sql:build" command process. To get more details, run the command with the "--verbose" option.' + 'An error has occured during the "propel:sql:build" command process. To get more details, run the command with the "--verbose" option.', ), 'fg=white;bg=red'); } } @@ -104,16 +100,17 @@ EOT * @param string $target target map filename * @param string $generated generated map filename * - * @return boolean result + * @return bool */ protected function mergeMapFiles($target, $generated) { - if(($targetContent = file($target)) === false) - + if (false === ($targetContent = file($target))) { return false; - if(($generatedContent = file($generated)) === false) + } + if (false === ($generatedContent = file($generated))) { return false; + } $targetContent = array_merge($generatedContent, array_diff($targetContent, $generatedContent)); diff --git a/Command/SqlInsertCommand.php b/Command/SqlInsertCommand.php index 2e57ee6..2bdb39f 100644 --- a/Command/SqlInsertCommand.php +++ b/Command/SqlInsertCommand.php @@ -7,10 +7,8 @@ * * @license MIT License */ - namespace Propel\PropelBundle\Command; -use Propel\PropelBundle\Command\AbstractCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface;