Browse Source

Shortened the if clause line length by doing it the @markstory style ;-)

Also shortened the line length  of some arrays
Marc Würth 12 years ago
parent
commit
84a669aa7a
1 changed files with 21 additions and 6 deletions
  1. 21 6
      lib/Cake/Console/Command/SchemaShell.php

+ 21 - 6
lib/Cake/Console/Command/SchemaShell.php

@@ -333,7 +333,10 @@ class SchemaShell extends AppShell {
 		$this->out("\n" . __d('cake_console', 'The following table(s) will be dropped.'));
 		$this->out(array_keys($drop));
 
-		if (!empty($this->params['yes']) || $this->in(__d('cake_console', 'Are you sure you want to drop the table(s)?'), array('y', 'n'), 'n') === 'y') {
+		if (
+			!empty($this->params['yes']) ||
+			$this->in(__d('cake_console', 'Are you sure you want to drop the table(s)?'), array('y', 'n'), 'n') === 'y'
+		) {
 			$this->out(__d('cake_console', 'Dropping table(s).'));
 			$this->_run($drop, 'drop', $Schema);
 		}
@@ -341,7 +344,10 @@ class SchemaShell extends AppShell {
 		$this->out("\n" . __d('cake_console', 'The following table(s) will be created.'));
 		$this->out(array_keys($create));
 
-		if (!empty($this->params['yes']) || $this->in(__d('cake_console', 'Are you sure you want to create the table(s)?'), array('y', 'n'), 'y') === 'y') {
+		if (
+			!empty($this->params['yes']) ||
+			$this->in(__d('cake_console', 'Are you sure you want to create the table(s)?'), array('y', 'n'), 'y') === 'y'
+		) {
 			$this->out(__d('cake_console', 'Creating table(s).'));
 			$this->_run($create, 'create', $Schema);
 		}
@@ -392,7 +398,10 @@ class SchemaShell extends AppShell {
 
 		$this->out("\n" . __d('cake_console', 'The following statements will run.'));
 		$this->out(array_map('trim', $contents));
-		if (!empty($this->params['yes']) || $this->in(__d('cake_console', 'Are you sure you want to alter the tables?'), array('y', 'n'), 'n') === 'y') {
+		if (
+			!empty($this->params['yes']) ||
+			$this->in(__d('cake_console', 'Are you sure you want to alter the tables?'), array('y', 'n'), 'n') === 'y'
+		) {
 			$this->out();
 			$this->out(__d('cake_console', 'Updating Database...'));
 			$this->_run($contents, 'update', $Schema);
@@ -471,7 +480,9 @@ class SchemaShell extends AppShell {
 			'default' => 'schema.php'
 		);
 		$name = array(
-			'help' => __d('cake_console', 'Classname to use. If its Plugin.class, both name and plugin options will be set.')
+			'help' => __d('cake_console',
+				'Classname to use. If its Plugin.class, both name and plugin options will be set.'
+			)
 		);
 		$snapshot = array(
 			'short' => 's',
@@ -482,7 +493,9 @@ class SchemaShell extends AppShell {
 			'help' => __d('cake_console', 'Specify models as comma separated list.'),
 		);
 		$dry = array(
-			'help' => __d('cake_console', 'Perform a dry run on create and update commands. Queries will be output instead of run.'),
+			'help' => __d('cake_console',
+				'Perform a dry run on create and update commands. Queries will be output instead of run.'
+			),
 			'boolean' => true
 		);
 		$force = array(
@@ -504,7 +517,9 @@ class SchemaShell extends AppShell {
 
 		$parser = parent::getOptionParser();
 		$parser->description(
-			__d('cake_console', 'The Schema Shell generates a schema object from the database and updates the database from the schema.')
+			__d('cake_console',
+				'The Schema Shell generates a schema object from the database and updates the database from the schema.'
+			)
 		)->addSubcommand('view', array(
 			'help' => __d('cake_console', 'Read and output the contents of a schema file'),
 			'parser' => array(