diff --git a/lib/Cake/Console/Command/TestShell.php b/lib/Cake/Console/Command/TestShell.php index b5f4abb06..9e8467c79 100644 --- a/lib/Cake/Console/Command/TestShell.php +++ b/lib/Cake/Console/Command/TestShell.php @@ -371,7 +371,6 @@ class TestShell extends Shell { } throw new Exception(__d('cake_dev', 'Test case %s cannot be run via this shell', $testFile)); - return false; } } diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index 114903811..3bbdb9217 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -462,7 +462,6 @@ class SecurityComponent extends Component { ); foreach ($fieldList as $i => $key) { - $isDisabled = false; $isLocked = (is_array($locked) && in_array($key, $locked)); if (!empty($unlockedFields)) { diff --git a/lib/Cake/Model/Behavior/ContainableBehavior.php b/lib/Cake/Model/Behavior/ContainableBehavior.php index 5dbffcda7..fbffc781f 100644 --- a/lib/Cake/Model/Behavior/ContainableBehavior.php +++ b/lib/Cake/Model/Behavior/ContainableBehavior.php @@ -266,7 +266,6 @@ class ContainableBehavior extends ModelBehavior { public function containments($Model, $contain, $containments = array(), $throwErrors = null) { $options = array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery'); $keep = array(); - $depth = array(); if ($throwErrors === null) { $throwErrors = (empty($this->settings[$Model->alias]) ? true : $this->settings[$Model->alias]['notices']); } diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index 04897686f..b4f807dec 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -274,7 +274,7 @@ class TreeBehavior extends ModelBehavior { } elseif (!$id) { $id = null; } - $name = $Model->alias; + extract($this->settings[$Model->alias]); if (!is_null($overrideRecursive)) { diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 568e06c82..1a25faeb4 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -607,10 +607,8 @@ class Mysql extends DboSource { */ public function listDetailedSources($name = null) { $condition = ''; - $params = array(); if (is_string($name)) { $condition = ' WHERE name = ' . $this->value($name); - $params = array($name); } $result = $this->_connection->query('SHOW TABLE STATUS ' . $condition, PDO::FETCH_ASSOC); diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 4d50779af..148a301ec 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -450,7 +450,6 @@ class Postgres extends DboSource { if ($key['indisprimary']) { $key['relname'] = 'PRIMARY'; } - $col = array(); preg_match('/\(([^\)]+)\)/', $key['statement'], $indexColumns); $parsedColumn = $indexColumns[1]; if (strpos($indexColumns[1], ',') !== false) { diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 15b34619a..ac1ce299d 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -151,7 +151,6 @@ class Sqlite extends DboSource { parent::listSources($tables); return $tables; } - return array(); } /** @@ -391,8 +390,6 @@ class Sqlite extends DboSource { return null; } - $real = $this->columns[$type]; - $out = $this->name($name) . ' ' . $real['name']; if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') { return $this->name($name) . ' ' . $this->columns['primary_key']['name']; } diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index 9b51bfad8..c6c6cd435 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -780,7 +780,6 @@ class Sqlserver extends DboSource { $out = ''; foreach ($schema->tables as $curTable => $columns) { if (!$table || $table == $curTable) { - $t = $this->fullTableName($curTable); $out .= "IF OBJECT_ID('" . $this->fullTableName($curTable, false). "', 'U') IS NOT NULL DROP TABLE " . $this->fullTableName($curTable) . ";\n"; } } diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index aa34a176a..cea930c1b 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -580,7 +580,6 @@ class DboSource extends DataSource { } else if (isset($args[1]) && !is_array($args[1]) ) { return $this->fetchAll($args[0], false); } else if (isset($args[1]) && is_array($args[1])) { - $offset = 0; if (isset($args[2])) { $cache = $args[2]; } else { @@ -2109,9 +2108,6 @@ class DboSource extends DataSource { * @return string */ public function resolveKey(Model $model, $key, $assoc = null) { - if (empty($assoc)) { - $assoc = $model->alias; - } if (strpos('.', $key) !== false) { return $this->name($model->alias) . '.' . $this->name($key); } @@ -2236,7 +2232,6 @@ class DboSource extends DataSource { ); $fields[$i] = $this->name(($prefix ? $alias . '.' : '') . $fields[$i]); } else { - $value = array(); if (strpos($fields[$i], ',') === false) { $build = explode('.', $fields[$i]); if (!Set::numeric($build)) { @@ -2788,7 +2783,6 @@ class DboSource extends DataSource { ); $columnMap = array(); - $count = count($values); $sql = "INSERT INTO {$table} ({$fields}) VALUES ({$holder})"; $statement = $this->_connection->prepare($sql); $this->begin(); diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 6cc6ce83c..6a98f5d3f 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -896,7 +896,6 @@ class Model extends Object implements CakeEventListener { $assocName = $value; $value = array(); } - $modelName = $assocName; $this->{$assoc}[$assocName] = $value; if (property_exists($this, $assocName)) { unset($this->{$assocName}); @@ -1193,7 +1192,6 @@ class Model extends Object implements CakeEventListener { return $data; } - $copy = $data; $type = $this->getColumnType($field); if (in_array($type, array('datetime', 'timestamp', 'date', 'time'))) { diff --git a/lib/Cake/Utility/CakeTime.php b/lib/Cake/Utility/CakeTime.php index 755e94747..653dd24d8 100644 --- a/lib/Cake/Utility/CakeTime.php +++ b/lib/Cake/Utility/CakeTime.php @@ -327,7 +327,6 @@ class CakeTime { * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting */ public static function dayAsSql($dateString, $fieldName, $userOffset = null) { - $date = self::fromString($dateString, $userOffset); return self::daysAsSql($dateString, $dateString, $fieldName); } @@ -559,9 +558,6 @@ class CakeTime { // If more than a week, then take into account the length of months if ($diff >= 604800) { - $current = array(); - $date = array(); - list($future['H'], $future['i'], $future['s'], $future['d'], $future['m'], $future['Y']) = explode('/', date('H/i/s/d/m/Y', $futureTime)); list($past['H'], $past['i'], $past['s'], $past['d'], $past['m'], $past['Y']) = explode('/', date('H/i/s/d/m/Y', $pastTime)); diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index a057d300d..595647407 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -803,7 +803,6 @@ class View extends Object { default: return $this->{$name}; } - return null; } /**