Permalink
Browse files

Remove unused variables and statements.

  • Loading branch information...
1 parent c40d132 commit 0cd9a93e9eaca11b24f9237a14b8c00cdf4da28a @majna majna committed Feb 17, 2012
@@ -371,7 +371,6 @@ protected function _mapFileToCase($file, $category, $throwOnMissingFile = true)
}
throw new Exception(__d('cake_dev', 'Test case %s cannot be run via this shell', $testFile));
- return false;
}
}
@@ -462,7 +462,6 @@ protected function _validatePost($controller) {
);
foreach ($fieldList as $i => $key) {
- $isDisabled = false;
$isLocked = (is_array($locked) && in_array($key, $locked));
if (!empty($unlockedFields)) {
@@ -266,7 +266,6 @@ public function resetBindings($Model) {
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']);
}
@@ -274,7 +274,7 @@ public function children($Model, $id = null, $direct = false, $fields = null, $o
} elseif (!$id) {
$id = null;
}
- $name = $Model->alias;
+
extract($this->settings[$Model->alias]);
if (!is_null($overrideRecursive)) {
@@ -607,10 +607,8 @@ protected function _alterIndexes($table, $indexes) {
*/
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);
@@ -450,7 +450,6 @@ public function index($model) {
if ($key['indisprimary']) {
$key['relname'] = 'PRIMARY';
}
- $col = array();
preg_match('/\(([^\)]+)\)/', $key['statement'], $indexColumns);
$parsedColumn = $indexColumns[1];
if (strpos($indexColumns[1], ',') !== false) {
@@ -151,7 +151,6 @@ public function listSources($data = null) {
parent::listSources($tables);
return $tables;
}
- return array();
}
/**
@@ -391,8 +390,6 @@ public function buildColumn($column) {
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'];
}
@@ -780,7 +780,6 @@ public function dropSchema(CakeSchema $schema, $table = null) {
$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";
}
}
@@ -580,7 +580,6 @@ public function query() {
} 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 @@ public function defaultConditions($model, $conditions, $useAlias = true) {
* @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 @@ public function fields($model, $alias = null, $fields = array(), $quote = true)
);
$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 @@ public function insertMulti($table, $fields, $values) {
);
$columnMap = array();
- $count = count($values);
$sql = "INSERT INTO {$table} ({$fields}) VALUES ({$holder})";
$statement = $this->_connection->prepare($sql);
$this->begin();
@@ -896,7 +896,6 @@ public function bindModel($params, $reset = true) {
$assocName = $value;
$value = array();
}
- $modelName = $assocName;
$this->{$assoc}[$assocName] = $value;
if (property_exists($this, $assocName)) {
unset($this->{$assocName});
@@ -1193,7 +1192,6 @@ public function deconstruct($field, $data) {
return $data;
}
- $copy = $data;
$type = $this->getColumnType($field);
if (in_array($type, array('datetime', 'timestamp', 'date', 'time'))) {
@@ -327,7 +327,6 @@ public static function daysAsSql($begin, $end, $fieldName, $userOffset = null) {
* @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 @@ public static function timeAgoInWords($dateTime, $options = array()) {
// 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));
@@ -803,7 +803,6 @@ public function __get($name) {
default:
return $this->{$name};
}
- return null;
}
/**

0 comments on commit 0cd9a93

Please sign in to comment.