mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-29 05:02:58 +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
lib/Cake
|
@ -371,7 +371,6 @@ class TestShell extends Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception(__d('cake_dev', 'Test case %s cannot be run via this shell', $testFile));
|
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) {
|
foreach ($fieldList as $i => $key) {
|
||||||
$isDisabled = false;
|
|
||||||
$isLocked = (is_array($locked) && in_array($key, $locked));
|
$isLocked = (is_array($locked) && in_array($key, $locked));
|
||||||
|
|
||||||
if (!empty($unlockedFields)) {
|
if (!empty($unlockedFields)) {
|
||||||
|
|
|
@ -266,7 +266,6 @@ class ContainableBehavior extends ModelBehavior {
|
||||||
public function containments($Model, $contain, $containments = array(), $throwErrors = null) {
|
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');
|
$options = array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery');
|
||||||
$keep = array();
|
$keep = array();
|
||||||
$depth = array();
|
|
||||||
if ($throwErrors === null) {
|
if ($throwErrors === null) {
|
||||||
$throwErrors = (empty($this->settings[$Model->alias]) ? true : $this->settings[$Model->alias]['notices']);
|
$throwErrors = (empty($this->settings[$Model->alias]) ? true : $this->settings[$Model->alias]['notices']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -274,7 +274,7 @@ class TreeBehavior extends ModelBehavior {
|
||||||
} elseif (!$id) {
|
} elseif (!$id) {
|
||||||
$id = null;
|
$id = null;
|
||||||
}
|
}
|
||||||
$name = $Model->alias;
|
|
||||||
extract($this->settings[$Model->alias]);
|
extract($this->settings[$Model->alias]);
|
||||||
|
|
||||||
if (!is_null($overrideRecursive)) {
|
if (!is_null($overrideRecursive)) {
|
||||||
|
|
|
@ -607,10 +607,8 @@ class Mysql extends DboSource {
|
||||||
*/
|
*/
|
||||||
public function listDetailedSources($name = null) {
|
public function listDetailedSources($name = null) {
|
||||||
$condition = '';
|
$condition = '';
|
||||||
$params = array();
|
|
||||||
if (is_string($name)) {
|
if (is_string($name)) {
|
||||||
$condition = ' WHERE name = ' . $this->value($name);
|
$condition = ' WHERE name = ' . $this->value($name);
|
||||||
$params = array($name);
|
|
||||||
}
|
}
|
||||||
$result = $this->_connection->query('SHOW TABLE STATUS ' . $condition, PDO::FETCH_ASSOC);
|
$result = $this->_connection->query('SHOW TABLE STATUS ' . $condition, PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,6 @@ class Postgres extends DboSource {
|
||||||
if ($key['indisprimary']) {
|
if ($key['indisprimary']) {
|
||||||
$key['relname'] = 'PRIMARY';
|
$key['relname'] = 'PRIMARY';
|
||||||
}
|
}
|
||||||
$col = array();
|
|
||||||
preg_match('/\(([^\)]+)\)/', $key['statement'], $indexColumns);
|
preg_match('/\(([^\)]+)\)/', $key['statement'], $indexColumns);
|
||||||
$parsedColumn = $indexColumns[1];
|
$parsedColumn = $indexColumns[1];
|
||||||
if (strpos($indexColumns[1], ',') !== false) {
|
if (strpos($indexColumns[1], ',') !== false) {
|
||||||
|
|
|
@ -151,7 +151,6 @@ class Sqlite extends DboSource {
|
||||||
parent::listSources($tables);
|
parent::listSources($tables);
|
||||||
return $tables;
|
return $tables;
|
||||||
}
|
}
|
||||||
return array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -391,8 +390,6 @@ class Sqlite extends DboSource {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$real = $this->columns[$type];
|
|
||||||
$out = $this->name($name) . ' ' . $real['name'];
|
|
||||||
if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {
|
if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {
|
||||||
return $this->name($name) . ' ' . $this->columns['primary_key']['name'];
|
return $this->name($name) . ' ' . $this->columns['primary_key']['name'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -780,7 +780,6 @@ class Sqlserver extends DboSource {
|
||||||
$out = '';
|
$out = '';
|
||||||
foreach ($schema->tables as $curTable => $columns) {
|
foreach ($schema->tables as $curTable => $columns) {
|
||||||
if (!$table || $table == $curTable) {
|
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";
|
$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]) ) {
|
} else if (isset($args[1]) && !is_array($args[1]) ) {
|
||||||
return $this->fetchAll($args[0], false);
|
return $this->fetchAll($args[0], false);
|
||||||
} else if (isset($args[1]) && is_array($args[1])) {
|
} else if (isset($args[1]) && is_array($args[1])) {
|
||||||
$offset = 0;
|
|
||||||
if (isset($args[2])) {
|
if (isset($args[2])) {
|
||||||
$cache = $args[2];
|
$cache = $args[2];
|
||||||
} else {
|
} else {
|
||||||
|
@ -2109,9 +2108,6 @@ class DboSource extends DataSource {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function resolveKey(Model $model, $key, $assoc = null) {
|
public function resolveKey(Model $model, $key, $assoc = null) {
|
||||||
if (empty($assoc)) {
|
|
||||||
$assoc = $model->alias;
|
|
||||||
}
|
|
||||||
if (strpos('.', $key) !== false) {
|
if (strpos('.', $key) !== false) {
|
||||||
return $this->name($model->alias) . '.' . $this->name($key);
|
return $this->name($model->alias) . '.' . $this->name($key);
|
||||||
}
|
}
|
||||||
|
@ -2236,7 +2232,6 @@ class DboSource extends DataSource {
|
||||||
);
|
);
|
||||||
$fields[$i] = $this->name(($prefix ? $alias . '.' : '') . $fields[$i]);
|
$fields[$i] = $this->name(($prefix ? $alias . '.' : '') . $fields[$i]);
|
||||||
} else {
|
} else {
|
||||||
$value = array();
|
|
||||||
if (strpos($fields[$i], ',') === false) {
|
if (strpos($fields[$i], ',') === false) {
|
||||||
$build = explode('.', $fields[$i]);
|
$build = explode('.', $fields[$i]);
|
||||||
if (!Set::numeric($build)) {
|
if (!Set::numeric($build)) {
|
||||||
|
@ -2788,7 +2783,6 @@ class DboSource extends DataSource {
|
||||||
);
|
);
|
||||||
$columnMap = array();
|
$columnMap = array();
|
||||||
|
|
||||||
$count = count($values);
|
|
||||||
$sql = "INSERT INTO {$table} ({$fields}) VALUES ({$holder})";
|
$sql = "INSERT INTO {$table} ({$fields}) VALUES ({$holder})";
|
||||||
$statement = $this->_connection->prepare($sql);
|
$statement = $this->_connection->prepare($sql);
|
||||||
$this->begin();
|
$this->begin();
|
||||||
|
|
|
@ -896,7 +896,6 @@ class Model extends Object implements CakeEventListener {
|
||||||
$assocName = $value;
|
$assocName = $value;
|
||||||
$value = array();
|
$value = array();
|
||||||
}
|
}
|
||||||
$modelName = $assocName;
|
|
||||||
$this->{$assoc}[$assocName] = $value;
|
$this->{$assoc}[$assocName] = $value;
|
||||||
if (property_exists($this, $assocName)) {
|
if (property_exists($this, $assocName)) {
|
||||||
unset($this->{$assocName});
|
unset($this->{$assocName});
|
||||||
|
@ -1193,7 +1192,6 @@ class Model extends Object implements CakeEventListener {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
$copy = $data;
|
|
||||||
$type = $this->getColumnType($field);
|
$type = $this->getColumnType($field);
|
||||||
|
|
||||||
if (in_array($type, array('datetime', 'timestamp', 'date', 'time'))) {
|
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
|
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
|
||||||
*/
|
*/
|
||||||
public static function dayAsSql($dateString, $fieldName, $userOffset = null) {
|
public static function dayAsSql($dateString, $fieldName, $userOffset = null) {
|
||||||
$date = self::fromString($dateString, $userOffset);
|
|
||||||
return self::daysAsSql($dateString, $dateString, $fieldName);
|
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 more than a week, then take into account the length of months
|
||||||
if ($diff >= 604800) {
|
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($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));
|
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:
|
default:
|
||||||
return $this->{$name};
|
return $this->{$name};
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue