mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Remove unused variables and statements.
This commit is contained in:
parent
c40d132f81
commit
0cd9a93e9e
12 changed files with 1 additions and 24 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ class TreeBehavior extends ModelBehavior {
|
|||
} elseif (!$id) {
|
||||
$id = null;
|
||||
}
|
||||
$name = $Model->alias;
|
||||
|
||||
extract($this->settings[$Model->alias]);
|
||||
|
||||
if (!is_null($overrideRecursive)) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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'))) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -803,7 +803,6 @@ class View extends Object {
|
|||
default:
|
||||
return $this->{$name};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue