Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:02
created
bin/prado-cli.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 		$this->_prefix = count($args) > 5 ? $args[5] : '';
642 642
 		$this->_postfix = count($args) > 6 ? $args[6] : '';
643 643
 
644
-		if ($app_dir !== false) {
644
+		if($app_dir !== false) {
645 645
 			$config = $this->getActiveRecordConfig($app_dir);
646 646
 
647 647
 			$manager = TActiveRecordManager::getInstance();
@@ -672,13 +672,13 @@  discard block
 block discarded – undo
672 672
 			$dataReader = $command->query();
673 673
 			$dataReader->bindColumn(1, $table);
674 674
 			$tables = [];
675
-			while ($dataReader->read() !== false) {
675
+			while($dataReader->read() !== false) {
676 676
 				$tables[] = $table;
677 677
 			}
678 678
 			$con->Active = false;
679
-			foreach ($tables as $key => $table) {
679
+			foreach($tables as $key => $table) {
680 680
 				$output = $args[1] . "." . $this->_prefix . ucfirst($table) . $this->_postfix;
681
-				if ($config !== false && $output !== false) {
681
+				if($config !== false && $output !== false) {
682 682
 					$this->generate("generate " . $table . " " . $output . " " . $this->_soap . " " . $this->_overwrite);
683 683
 				}
684 684
 			}
@@ -694,9 +694,9 @@  discard block
 block discarded – undo
694 694
 			$app_dir = '.';
695 695
 			if(Prado::getApplication() !== null)
696 696
 				$app_dir = dirname(Prado::getApplication()->getBasePath());
697
-			$args = [$input[0],$input[1], $input[2],$app_dir];
697
+			$args = [$input[0], $input[1], $input[2], $app_dir];
698 698
 			if(count($input) > 3)
699
-				$args = [$input[0],$input[1], $input[2],$app_dir,'soap'];
699
+				$args = [$input[0], $input[1], $input[2], $app_dir, 'soap'];
700 700
 			$cmd = new PradoCommandLineActiveRecordGen;
701 701
 			$cmd->performAction($args);
702 702
 		}
@@ -707,30 +707,30 @@  discard block
 block discarded – undo
707 707
 	}
708 708
 
709 709
 	protected function getAppDir($dir = ".") {
710
-		if (is_dir($dir))
710
+		if(is_dir($dir))
711 711
 			return realpath($dir);
712
-		if (false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir))
712
+		if(false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir))
713 713
 			return $app_dir;
714 714
 		echo '** Unable to find directory "' . $dir . "\".\n";
715 715
 		return false;
716 716
 	}
717 717
 
718 718
 	protected function getXmlFile($app_dir) {
719
-		if (false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml))
719
+		if(false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml))
720 720
 			return $xml;
721
-		if (false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml))
721
+		if(false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml))
722 722
 			return $xml;
723 723
 		echo '** Unable to find application.xml in ' . $app_dir . "\n";
724 724
 		return false;
725 725
 	}
726 726
 
727 727
 	protected function getActiveRecordConfig($app_dir) {
728
-		if (false === ($xml = $this->getXmlFile($app_dir)))
728
+		if(false === ($xml = $this->getXmlFile($app_dir)))
729 729
 			return false;
730
-		if (false !== ($app = $this->initializePradoApplication($app_dir))) {
730
+		if(false !== ($app = $this->initializePradoApplication($app_dir))) {
731 731
 			Prado::using('System.Data.ActiveRecord.TActiveRecordConfig');
732
-			foreach ($app->getModules() as $module)
733
-				if ($module instanceof TActiveRecordConfig)
732
+			foreach($app->getModules() as $module)
733
+				if($module instanceof TActiveRecordConfig)
734 734
 					return $module;
735 735
 			echo '** Unable to find TActiveRecordConfig module in ' . $xml . "\n";
736 736
 		}
@@ -738,11 +738,11 @@  discard block
 block discarded – undo
738 738
 	}
739 739
 
740 740
 	protected function getOutputFile($app_dir, $namespace) {
741
-		if (is_file($namespace) && strpos($namespace, $app_dir) === 0)
741
+		if(is_file($namespace) && strpos($namespace, $app_dir) === 0)
742 742
 			return $namespace;
743 743
 		$file = Prado::getPathOfNamespace($namespace, "");
744
-		if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) {
745
-			if (strpos($path, $app_dir) === 0)
744
+		if($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) {
745
+			if(strpos($path, $app_dir) === 0)
746 746
 				return $file;
747 747
 		}
748 748
 		echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n";
Please login to merge, or discard this patch.