From 200dd2dc9bf6f8117b340ea5c75b440faac4949d Mon Sep 17 00:00:00 2001 From: Kyle Robinson Young Date: Tue, 4 Sep 2012 10:57:47 -0700 Subject: [PATCH] Code standards fixes, unneeded break statements --- lib/Cake/Console/Command/ConsoleShell.php | 1 - lib/Cake/Core/Object.php | 1 - lib/Cake/Model/Datasource/Database/Mysql.php | 1 - lib/Cake/Model/Datasource/Database/Postgres.php | 3 --- lib/Cake/Model/Datasource/Database/Sqlite.php | 2 -- lib/Cake/Model/Datasource/Database/Sqlserver.php | 2 -- lib/Cake/Model/Datasource/DboSource.php | 4 ---- lib/Cake/Model/Permission.php | 1 - lib/Cake/Utility/CakeTime.php | 2 -- lib/Cake/Utility/Debugger.php | 7 ------- lib/Cake/Utility/Security.php | 3 --- 11 files changed, 27 deletions(-) diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index e9d528ca9..d8c79c933 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -175,7 +175,6 @@ class ConsoleShell extends AppShell { case 'quit': case 'exit': return true; - break; case 'models': $this->out(__d('cake_console', 'Model classes:')); $this->hr(); diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php index 9723a2801..d95855788 100644 --- a/lib/Cake/Core/Object.php +++ b/lib/Cake/Core/Object.php @@ -123,7 +123,6 @@ class Object { return $this->{$method}($params[0], $params[1], $params[2], $params[3], $params[4]); default: return call_user_func_array(array(&$this, $method), $params); - break; } } diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 9506a8a94..c26de45e7 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -532,7 +532,6 @@ class Mysql extends DboSource { * @param string $table Table to alter parameters for. * @param array $parameters Parameters to add & drop. * @return array Array of table property alteration statements. - * @todo Implement this method. */ protected function _alterTableParameters($table, $parameters) { if (isset($parameters['change'])) { diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 74da3465b..cd7cffcac 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -649,7 +649,6 @@ class Postgres extends DboSource { return 'float'; default: return 'text'; - break; } } @@ -879,10 +878,8 @@ class Postgres extends DboSource { } } return "CREATE TABLE {$table} (\n\t{$columns}\n);\n{$indexes}"; - break; default: return parent::renderStatement($type, $data); - break; } } diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 63ed60391..e85504ed5 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -516,10 +516,8 @@ class Sqlite extends DboSource { $indexes = "\t" . join("\n\t", array_filter($indexes)); } return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}"; - break; default: return parent::renderStatement($type, $data); - break; } } diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index b23e59a16..eaf93f433 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -533,10 +533,8 @@ class Sqlserver extends DboSource { } } return "CREATE TABLE {$table} (\n{$columns});\n{$indexes}"; - break; default: return parent::renderStatement($type, $data); - break; } } diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 02135bd65..e05763b0e 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -341,10 +341,8 @@ class DboSource extends DataSource { switch ($column) { case 'binary': return $this->_connection->quote($data, PDO::PARAM_LOB); - break; case 'boolean': return $this->_connection->quote($this->boolean($data, true), PDO::PARAM_BOOL); - break; case 'string': case 'text': return $this->_connection->quote($data, PDO::PARAM_STR); @@ -362,7 +360,6 @@ class DboSource extends DataSource { return $data; } return $this->_connection->quote($data); - break; } } @@ -2029,7 +2026,6 @@ class DboSource extends DataSource { $arg = $this->name($params[0]); } return strtoupper($func) . '(' . $arg . ') AS ' . $this->name($params[1]); - break; } } diff --git a/lib/Cake/Model/Permission.php b/lib/Cake/Model/Permission.php index 8decc7f7f..b7c92d1a7 100644 --- a/lib/Cake/Model/Permission.php +++ b/lib/Cake/Model/Permission.php @@ -149,7 +149,6 @@ class Permission extends AppModel { break; case 1: return true; - break; } } } diff --git a/lib/Cake/Utility/CakeTime.php b/lib/Cake/Utility/CakeTime.php index 67e9cc342..f5e343fc6 100644 --- a/lib/Cake/Utility/CakeTime.php +++ b/lib/Cake/Utility/CakeTime.php @@ -112,10 +112,8 @@ class CakeTime { switch ($name) { case 'niceFormat': return self::${$name}; - break; default: return null; - break; } } diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index 514b16d9e..3a58cb326 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -250,7 +250,6 @@ class Debugger { break; default: return; - break; } $data = compact( @@ -474,29 +473,23 @@ class Debugger { switch (self::getType($var)) { case 'boolean': return ($var) ? 'true' : 'false'; - break; case 'integer': return '(int) ' . $var; case 'float': return '(float) ' . $var; - break; case 'string': if (trim($var) == '') { return "''"; } return "'" . $var . "'"; - break; case 'array': return self::_array($var, $depth - 1, $indent + 1); - break; case 'resource': return strtolower(gettype($var)); - break; case 'null': return 'null'; default: return self::_object($var, $depth - 1, $indent + 1); - break; } } diff --git a/lib/Cake/Utility/Security.php b/lib/Cake/Utility/Security.php index 6438338a2..857415c9a 100644 --- a/lib/Cake/Utility/Security.php +++ b/lib/Cake/Utility/Security.php @@ -42,14 +42,11 @@ class Security { switch (Configure::read('Security.level')) { case 'high': return 10; - break; case 'medium': return 100; - break; case 'low': default: return 300; - break; } }