mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Unused variables in Console removed
This commit is contained in:
parent
b6c4b8abb5
commit
cebcd64090
7 changed files with 2 additions and 11 deletions
|
@ -61,7 +61,7 @@ class SchemaShell extends Shell {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function startup() {
|
public function startup() {
|
||||||
$name = $file = $path = $connection = $plugin = null;
|
$name = $path = $connection = $plugin = null;
|
||||||
if (!empty($this->params['name'])) {
|
if (!empty($this->params['name'])) {
|
||||||
$name = $this->params['name'];
|
$name = $this->params['name'];
|
||||||
} elseif (!empty($this->args[0])) {
|
} elseif (!empty($this->args[0])) {
|
||||||
|
|
|
@ -140,7 +140,6 @@ class FixtureTask extends BakeTask {
|
||||||
$this->out(sprintf("Bake Fixture\nPath: %s", $this->path));
|
$this->out(sprintf("Bake Fixture\nPath: %s", $this->path));
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
||||||
$useDbConfig = $this->connection;
|
|
||||||
if (!isset($this->connection)) {
|
if (!isset($this->connection)) {
|
||||||
$this->connection = $this->DbConfig->getConfig();
|
$this->connection = $this->DbConfig->getConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,7 +462,6 @@ class ModelTask extends BakeTask {
|
||||||
$associations = array(
|
$associations = array(
|
||||||
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
|
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
|
||||||
);
|
);
|
||||||
$possibleKeys = array();
|
|
||||||
|
|
||||||
$associations = $this->findBelongsTo($model, $associations);
|
$associations = $this->findBelongsTo($model, $associations);
|
||||||
$associations = $this->findHasOneAndMany($model, $associations);
|
$associations = $this->findHasOneAndMany($model, $associations);
|
||||||
|
@ -608,8 +607,6 @@ class ModelTask extends BakeTask {
|
||||||
public function confirmAssociations($model, $associations) {
|
public function confirmAssociations($model, $associations) {
|
||||||
foreach ($associations as $type => $settings) {
|
foreach ($associations as $type => $settings) {
|
||||||
if (!empty($associations[$type])) {
|
if (!empty($associations[$type])) {
|
||||||
$count = count($associations[$type]);
|
|
||||||
$response = 'y';
|
|
||||||
foreach ($associations[$type] as $i => $assoc) {
|
foreach ($associations[$type] as $i => $assoc) {
|
||||||
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
|
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
|
||||||
$response = $this->in($prompt, array('y','n'), 'y');
|
$response = $this->in($prompt, array('y','n'), 'y');
|
||||||
|
@ -647,7 +644,6 @@ class ModelTask extends BakeTask {
|
||||||
|
|
||||||
$alias = $this->in(__d('cake_console', 'What is the alias for this association?'));
|
$alias = $this->in(__d('cake_console', 'What is the alias for this association?'));
|
||||||
$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias );
|
$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias );
|
||||||
$suggestedForeignKey = null;
|
|
||||||
|
|
||||||
if ($assocType == 0) {
|
if ($assocType == 0) {
|
||||||
$showKeys = $possibleKeys[$model->table];
|
$showKeys = $possibleKeys[$model->table];
|
||||||
|
|
|
@ -50,8 +50,6 @@ class PluginTask extends Shell {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function execute() {
|
public function execute() {
|
||||||
$plugin = null;
|
|
||||||
|
|
||||||
if (isset($this->args[0])) {
|
if (isset($this->args[0])) {
|
||||||
$plugin = Inflector::camelize($this->args[0]);
|
$plugin = Inflector::camelize($this->args[0]);
|
||||||
$pluginPath = $this->_pluginPath($plugin);
|
$pluginPath = $this->_pluginPath($plugin);
|
||||||
|
|
|
@ -106,7 +106,6 @@ class TemplateTask extends Shell {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function set($one, $two = null) {
|
public function set($one, $two = null) {
|
||||||
$data = null;
|
|
||||||
if (is_array($one)) {
|
if (is_array($one)) {
|
||||||
if (is_array($two)) {
|
if (is_array($two)) {
|
||||||
$data = array_combine($one, $two);
|
$data = array_combine($one, $two);
|
||||||
|
|
|
@ -106,7 +106,7 @@ class ViewTask extends BakeTask {
|
||||||
if (!isset($this->connection)) {
|
if (!isset($this->connection)) {
|
||||||
$this->connection = 'default';
|
$this->connection = 'default';
|
||||||
}
|
}
|
||||||
$controller = $action = $alias = null;
|
$action = null;
|
||||||
$this->controllerName = $this->_controllerName($this->args[0]);
|
$this->controllerName = $this->_controllerName($this->args[0]);
|
||||||
$this->controllerPath = $this->_controllerPath($this->controllerName);
|
$this->controllerPath = $this->_controllerPath($this->controllerName);
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ class TaskCollection extends ObjectCollection {
|
||||||
if (isset($this->_loaded[$name])) {
|
if (isset($this->_loaded[$name])) {
|
||||||
return $this->_loaded[$name];
|
return $this->_loaded[$name];
|
||||||
}
|
}
|
||||||
$taskFile = Inflector::underscore($name);
|
|
||||||
$taskClass = $name . 'Task';
|
$taskClass = $name . 'Task';
|
||||||
App::uses($taskClass, $plugin . 'Console/Command/Task');
|
App::uses($taskClass, $plugin . 'Console/Command/Task');
|
||||||
if (!class_exists($taskClass)) {
|
if (!class_exists($taskClass)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue