Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unused local variables and a few improvements

  • Loading branch information...
commit 3f4d24bfc0e19e212dfefbb678f1de86116948d5 1 parent f25f353
@ceeram ceeram authored
Showing with 77 additions and 95 deletions.
  1. +1 −1  lib/Cake/Console/Command/ConsoleShell.php
  2. +1 −1  lib/Cake/Console/Command/ServerShell.php
  3. +1 −1  lib/Cake/Console/Command/Task/DbConfigTask.php
  4. +2 −2 lib/Cake/Console/Command/Task/FixtureTask.php
  5. +5 −8 lib/Cake/Console/Command/Task/ModelTask.php
  6. +1 −1  lib/Cake/Console/Command/Task/PluginTask.php
  7. +2 −2 lib/Cake/Console/Command/Task/ViewTask.php
  8. +1 −1  lib/Cake/Console/Command/TestShell.php
  9. +1 −3 lib/Cake/Console/Shell.php
  10. +1 −2  lib/Cake/Controller/Component/Acl/PhpAcl.php
  11. +1 −1  lib/Cake/Controller/Component/Auth/BaseAuthenticate.php
  12. +1 −1  lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php
  13. +1 −1  lib/Cake/Controller/Component/Auth/DigestAuthenticate.php
  14. +1 −1  lib/Cake/Controller/Component/Auth/FormAuthenticate.php
  15. +2 −2 lib/Cake/Controller/Scaffold.php
  16. +0 −1  lib/Cake/Core/Configure.php
  17. +1 −1  lib/Cake/I18n/L10n.php
  18. +1 −1  lib/Cake/Model/AclNode.php
  19. +1 −1  lib/Cake/Model/Behavior/ContainableBehavior.php
  20. +2 −2 lib/Cake/Model/BehaviorCollection.php
  21. +2 −2 lib/Cake/Model/CakeSchema.php
  22. +1 −1  lib/Cake/Model/Datasource/DataSource.php
  23. +5 −13 lib/Cake/Model/Datasource/Database/Mysql.php
  24. +1 −1  lib/Cake/Model/Datasource/Database/Postgres.php
  25. +5 −13 lib/Cake/Model/Datasource/Database/Sqlite.php
  26. +5 −13 lib/Cake/Model/Datasource/Database/Sqlserver.php
  27. +20 −6 lib/Cake/Model/Datasource/DboSource.php
  28. +1 −1  lib/Cake/Model/Model.php
  29. +1 −1  lib/Cake/Network/CakeRequest.php
  30. +1 −1  lib/Cake/Network/CakeResponse.php
  31. +1 −1  lib/Cake/Routing/Router.php
  32. +1 −1  lib/Cake/Utility/ClassRegistry.php
  33. +1 −1  lib/Cake/Utility/Folder.php
  34. +1 −2  lib/Cake/View/Helper/HtmlHelper.php
  35. +1 −1  lib/Cake/View/Helper/JsHelper.php
  36. +1 −1  lib/Cake/View/JsonView.php
  37. +1 −1  lib/Cake/View/View.php
  38. +1 −1  lib/Cake/View/XmlView.php
View
2  lib/Cake/Console/Command/ConsoleShell.php
@@ -293,7 +293,7 @@ public function main($command = null) {
if ($this->_isValidModel($modelToSave)) {
// Extract the array of data we are trying to build
- list($foo, $data) = explode("->save", $command);
+ list(, $data) = explode("->save", $command);
$data = preg_replace('/^\(*(array)?\(*(.+?)\)*$/i', '\\2', $data);
$saveCommand = "\$this->{$modelToSave}->save(array('{$modelToSave}' => array({$data})));";
//@codingStandardsIgnoreStart
View
2  lib/Cake/Console/Command/ServerShell.php
@@ -133,7 +133,7 @@ public function main() {
$port = ($this->_port == self::DEFAULT_PORT) ? '' : ':' . $this->_port;
$this->out(__d('cake_console', 'built-in server is running in http://%s%s/', $this->_host, $port));
- $ret = system($command);
+ system($command);
}
/**
View
2  lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -296,7 +296,7 @@ public function bake($configs) {
}
foreach ($oldConfigs as $key => $oldConfig) {
- foreach ($configs as $k => $config) {
+ foreach ($configs as $config) {
if ($oldConfig['name'] == $config['name']) {
unset($oldConfigs[$key]);
}
View
4 lib/Cake/Console/Command/Task/FixtureTask.php
@@ -232,7 +232,7 @@ public function bake($model, $useTable = false, $importOptions = array()) {
if (!empty($this->params['records']) || isset($importOptions['fromTable'])) {
$records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable));
}
- $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));
+ $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import'));
return $out;
}
@@ -402,7 +402,7 @@ protected function _getRecordsFromTable($modelName, $useTable = null) {
'recursive' => -1,
'limit' => $recordCount
));
- $db = $modelObject->getDatasource();
+
$schema = $modelObject->schema(true);
$out = array();
foreach ($records as $record) {
View
13 lib/Cake/Console/Command/Task/ModelTask.php
@@ -377,7 +377,7 @@ public function initValidations() {
}
sort($options);
$default = 1;
- foreach ($options as $key => $option) {
+ foreach ($options as $option) {
if ($option{0} != '_') {
$choices[$default] = strtolower($option);
$default++;
@@ -545,8 +545,8 @@ public function doAssociations($model) {
* @return array $associations with belongsTo added in.
*/
public function findBelongsTo(Model $model, $associations) {
- $fields = $model->schema(true);
- foreach ($fields as $fieldName => $field) {
+ $fieldNames = array_keys($model->schema(true));
+ foreach ($fieldNames as $fieldName) {
$offset = strpos($fieldName, '_id');
if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) {
$tmpModelName = $this->_modelNameFromKey($fieldName);
@@ -577,14 +577,14 @@ public function findHasOneAndMany(Model $model, $associations) {
$foreignKey = $this->_modelKey($model->name);
foreach ($this->_tables as $otherTable) {
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
- $modelFieldsTemp = $tempOtherModel->schema(true);
+ $tempFieldNames = array_keys($tempOtherModel->schema(true));
$pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/';
$possibleJoinTable = preg_match($pattern, $otherTable);
if ($possibleJoinTable) {
continue;
}
- foreach ($modelFieldsTemp as $fieldName => $field) {
+ foreach ($tempFieldNames as $fieldName) {
$assoc = false;
if ($fieldName != $model->primaryKey && $fieldName == $foreignKey) {
$assoc = array(
@@ -619,9 +619,6 @@ public function findHasOneAndMany(Model $model, $associations) {
public function findHasAndBelongsToMany(Model $model, $associations) {
$foreignKey = $this->_modelKey($model->name);
foreach ($this->_tables as $otherTable) {
- $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
- $modelFieldsTemp = $tempOtherModel->schema(true);
-
$offset = strpos($otherTable, $model->table . '_');
$otherOffset = strpos($otherTable, '_' . $model->table);
View
2  lib/Cake/Console/Command/Task/PluginTask.php
@@ -127,7 +127,7 @@ public function bake($plugin) {
foreach ($directories as $directory) {
$dirPath = $this->path . $plugin . DS . $directory;
$Folder->create($dirPath);
- $File = new File($dirPath . DS . 'empty', true);
+ new File($dirPath . DS . 'empty', true);
}
foreach ($Folder->messages() as $message) {
View
4 lib/Cake/Console/Command/Task/ViewTask.php
@@ -452,9 +452,9 @@ protected function _associations(Model $model) {
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$associations = array();
- foreach ($keys as $key => $type) {
+ foreach ($keys as $type) {
foreach ($model->{$type} as $assocKey => $assocData) {
- list($plugin, $modelClass) = pluginSplit($assocData['className']);
+ list(, $modelClass) = pluginSplit($assocData['className']);
$associations[$type][$assocKey]['primaryKey'] = $model->{$assocKey}->primaryKey;
$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
View
2  lib/Cake/Console/Command/TestShell.php
@@ -303,7 +303,7 @@ public function available() {
$this->out($title);
$i = 1;
$cases = array();
- foreach ($testCases as $testCaseFile => $testCase) {
+ foreach ($testCases as $testCase) {
$case = str_replace('Test.php', '', $testCase);
$this->out("[$i] $case");
$cases[$i] = $case;
View
4 lib/Cake/Console/Shell.php
@@ -261,9 +261,7 @@ public function loadTasks() {
return true;
}
$this->_taskMap = TaskCollection::normalizeObjectArray((array)$this->tasks);
- foreach ($this->_taskMap as $task => $properties) {
- $this->taskNames[] = $task;
- }
+ $this->taskNames = array_merge($this->taskNames, array_keys($this->_taskMap));
return true;
}
View
3  lib/Cake/Controller/Component/Acl/PhpAcl.php
@@ -174,7 +174,7 @@ public function check($aro, $aco, $action = "*") {
return $allow;
}
- foreach ($path as $depth => $node) {
+ foreach ($path as $node) {
foreach ($prioritizedAros as $aros) {
if (!empty($node['allow'])) {
$allow = $allow || count(array_intersect($node['allow'], $aros));
@@ -336,7 +336,6 @@ public function resolve($aco) {
*/
public function build(array $allow, array $deny = array()) {
$this->_tree = array();
- $tree = array();
foreach ($allow as $dotPath => $aros) {
if (is_string($aros)) {
View
2  lib/Cake/Controller/Component/Auth/BaseAuthenticate.php
@@ -75,7 +75,7 @@ public function __construct(ComponentCollection $collection, $settings) {
*/
protected function _findUser($conditions, $password = null) {
$userModel = $this->settings['userModel'];
- list($plugin, $model) = pluginSplit($userModel);
+ list(, $model) = pluginSplit($userModel);
$fields = $this->settings['fields'];
if (!is_array($conditions)) {
View
2  lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php
@@ -50,7 +50,7 @@ class BlowfishAuthenticate extends FormAuthenticate {
*/
public function authenticate(CakeRequest $request, CakeResponse $response) {
$userModel = $this->settings['userModel'];
- list($plugin, $model) = pluginSplit($userModel);
+ list(, $model) = pluginSplit($userModel);
$fields = $this->settings['fields'];
if (!$this->_checkFields($request, $model, $fields)) {
View
2  lib/Cake/Controller/Component/Auth/DigestAuthenticate.php
@@ -159,7 +159,7 @@ public function getUser($request) {
*/
protected function _findUser($username, $password = null) {
$userModel = $this->settings['userModel'];
- list($plugin, $model) = pluginSplit($userModel);
+ list(, $model) = pluginSplit($userModel);
$fields = $this->settings['fields'];
$conditions = array(
View
2  lib/Cake/Controller/Component/Auth/FormAuthenticate.php
@@ -68,7 +68,7 @@ protected function _checkFields(CakeRequest $request, $model, $fields) {
*/
public function authenticate(CakeRequest $request, CakeResponse $response) {
$userModel = $this->settings['userModel'];
- list($plugin, $model) = pluginSplit($userModel);
+ list(, $model) = pluginSplit($userModel);
$fields = $this->settings['fields'];
if (!$this->_checkFields($request, $model, $fields)) {
View
4 lib/Cake/Controller/Scaffold.php
@@ -137,7 +137,7 @@ public function __construct(Controller $controller, CakeRequest $request) {
$associations = $this->_associations();
$this->controller->set(compact(
- 'title_for_layout', 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
+ 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'
));
$this->controller->set('title_for_layout', $title);
@@ -422,7 +422,7 @@ protected function _associations() {
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$associations = array();
- foreach ($keys as $key => $type) {
+ foreach ($keys as $type) {
foreach ($this->ScaffoldModel->{$type} as $assocKey => $assocData) {
$associations[$type][$assocKey]['primaryKey'] =
$this->ScaffoldModel->{$assocKey}->primaryKey;
View
1  lib/Cake/Core/Configure.php
@@ -197,7 +197,6 @@ public static function check($var = null) {
* @return void
*/
public static function delete($var = null) {
- $keys = explode('.', $var);
self::$_values = Hash::remove(self::$_values, $var);
}
View
2  lib/Cake/I18n/L10n.php
@@ -414,7 +414,7 @@ protected function _setLanguage($language = null) {
*/
protected function _autoLanguage() {
$_detectableLanguages = CakeRequest::acceptLanguage();
- foreach ($_detectableLanguages as $key => $langKey) {
+ foreach ($_detectableLanguages as $langKey) {
if (isset($this->_l10nCatalog[$langKey])) {
$this->_setLanguage($langKey);
return true;
View
2  lib/Cake/Model/AclNode.php
@@ -124,7 +124,7 @@ public function node($ref = null) {
$ref = array('model' => $ref->name, 'foreign_key' => $ref->id);
} elseif (is_array($ref) && !(isset($ref['model']) && isset($ref['foreign_key']))) {
$name = key($ref);
- list($plugin, $alias) = pluginSplit($name);
+ list(, $alias) = pluginSplit($name);
$model = ClassRegistry::init(array('class' => $name, 'alias' => $alias));
View
2  lib/Cake/Model/Behavior/ContainableBehavior.php
@@ -124,7 +124,7 @@ public function beforeFind(Model $Model, $query) {
$map = $this->containmentsMap($containments);
$mandatory = array();
- foreach ($containments['models'] as $name => $model) {
+ foreach ($containments['models'] as $model) {
$instance = $model['instance'];
$needed = $this->fieldDependencies($instance, $map, false);
if (!empty($needed)) {
View
4 lib/Cake/Model/BehaviorCollection.php
@@ -63,7 +63,7 @@ public function init($modelName, $behaviors = array()) {
$this->modelName = $modelName;
if (!empty($behaviors)) {
- foreach (BehaviorCollection::normalizeObjectArray($behaviors) as $behavior => $config) {
+ foreach (BehaviorCollection::normalizeObjectArray($behaviors) as $config) {
$this->load($config['class'], $config['settings']);
}
}
@@ -183,7 +183,7 @@ public function load($behavior, $config = array()) {
* @return void
*/
public function unload($name) {
- list($plugin, $name) = pluginSplit($name);
+ list(, $name) = pluginSplit($name);
if (isset($this->_loaded[$name])) {
$this->_loaded[$name]->cleanup(ClassRegistry::getObject($this->modelName));
parent::unload($name);
View
4 lib/Cake/Model/CakeSchema.php
@@ -279,7 +279,7 @@ public function read($options = array()) {
if (empty($Object->hasAndBelongsToMany)) {
continue;
}
- foreach ($Object->hasAndBelongsToMany as $Assoc => $assocData) {
+ foreach ($Object->hasAndBelongsToMany as $assocData) {
if (isset($assocData['with'])) {
$class = $assocData['with'];
}
@@ -607,7 +607,7 @@ protected function _columns(&$Obj) {
$db = $Obj->getDataSource();
$fields = $Obj->schema(true);
- $columns = $props = array();
+ $columns = array();
foreach ($fields as $name => $value) {
if ($Obj->primaryKey == $name) {
$value['key'] = 'primary';
View
2  lib/Cake/Model/Datasource/DataSource.php
@@ -355,7 +355,7 @@ public function insertQueryData($query, $data, $association, $assocData, Model $
$type = $model->getColumnType($model->primaryKey);
break;
case '{$__cakeForeignKey__$}':
- foreach ($model->associations() as $id => $name) {
+ foreach ($model->associations() as $name) {
foreach ($model->$name as $assocName => $assoc) {
if ($assocName === $association) {
if (isset($assoc['foreignKey'])) {
View
18 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -541,21 +541,13 @@ public function alterSchema($compare, $table = null) {
}
/**
- * Generate a MySQL "drop table" statement for the given Schema object
+ * Generate a "drop table" statement for the given table
*
- * @param CakeSchema $schema An instance of a subclass of CakeSchema
- * @param string $table Optional. If specified only the table name given will be generated.
- * Otherwise, all tables defined in the schema are generated.
- * @return string
+ * @param type $table Name of the table to drop
+ * @return string Drop table SQL statement
*/
- public function dropSchema(CakeSchema $schema, $table = null) {
- $out = '';
- foreach ($schema->tables as $curTable => $columns) {
- if (!$table || $table === $curTable) {
- $out .= 'DROP TABLE IF EXISTS ' . $this->fullTableName($curTable) . ";\n";
- }
- }
- return $out;
+ protected function _dropTable($table) {
+ return 'DROP TABLE IF EXISTS ' . $this->fullTableName($table) . ";";
}
/**
View
2  lib/Cake/Model/Datasource/Database/Postgres.php
@@ -334,7 +334,7 @@ public function truncate($table, $reset = false) {
if ($this->execute('DELETE FROM ' . $this->fullTableName($table))) {
$schema = $this->config['schema'];
if (isset($this->_sequenceMap[$table]) && $reset != true) {
- foreach ($this->_sequenceMap[$table] as $field => $sequence) {
+ foreach ($this->_sequenceMap[$table] as $sequence) {
list($schema, $sequence) = explode('.', $sequence);
$this->_execute("ALTER SEQUENCE \"{$schema}\".\"{$sequence}\" RESTART WITH 1");
}
View
18 lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -550,21 +550,13 @@ public function hasResult() {
}
/**
- * Generate a "drop table" statement for the given Schema object
+ * Generate a "drop table" statement for the given table
*
- * @param CakeSchema $schema An instance of a subclass of CakeSchema
- * @param string $table Optional. If specified only the table name given will be generated.
- * Otherwise, all tables defined in the schema are generated.
- * @return string
+ * @param type $table Name of the table to drop
+ * @return string Drop table SQL statement
*/
- public function dropSchema(CakeSchema $schema, $table = null) {
- $out = '';
- foreach ($schema->tables as $curTable => $columns) {
- if (!$table || $table == $curTable) {
- $out .= 'DROP TABLE IF EXISTS ' . $this->fullTableName($curTable) . ";\n";
- }
- }
- return $out;
+ protected function _dropTable($table) {
+ return 'DROP TABLE IF EXISTS ' . $this->fullTableName($table) . ";";
}
/**
View
18 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -759,21 +759,13 @@ protected function _execute($sql, $params = array(), $prepareOptions = array())
}
/**
- * Generate a "drop table" statement for the given Schema object
+ * Generate a "drop table" statement for the given table
*
- * @param CakeSchema $schema An instance of a subclass of CakeSchema
- * @param string $table Optional. If specified only the table name given will be generated.
- * Otherwise, all tables defined in the schema are generated.
- * @return string
+ * @param type $table Name of the table to drop
+ * @return string Drop table SQL statement
*/
- public function dropSchema(CakeSchema $schema, $table = null) {
- $out = '';
- foreach ($schema->tables as $curTable => $columns) {
- if (!$table || $table == $curTable) {
- $out .= "IF OBJECT_ID('" . $this->fullTableName($curTable, false) . "', 'U') IS NOT NULL DROP TABLE " . $this->fullTableName($curTable) . ";\n";
- }
- }
- return $out;
+ protected function _dropTable($table) {
+ return "IF OBJECT_ID('" . $this->fullTableName($table, false) . "', 'U') IS NOT NULL DROP TABLE " . $this->fullTableName($table) . ";";
}
/**
View
26 lib/Cake/Model/Datasource/DboSource.php
@@ -1932,7 +1932,7 @@ protected function _matchRecords(Model $model, $conditions = null) {
foreach ($conditions as $field => $value) {
$originalField = $field;
if (strpos($field, '.') !== false) {
- list($alias, $field) = explode('.', $field);
+ list(, $field) = explode('.', $field);
$field = ltrim($field, $this->startQuote);
$field = rtrim($field, $this->endQuote);
}
@@ -2973,7 +2973,7 @@ public function createSchema($schema, $tableName = null) {
foreach ($schema->tables as $curTable => $columns) {
if (!$tableName || $tableName == $curTable) {
- $cols = $colList = $indexes = $tableParameters = array();
+ $cols = $indexes = $tableParameters = array();
$primary = null;
$table = $this->fullTableName($curTable);
@@ -3042,15 +3042,29 @@ public function alterSchema($compare, $table = null) {
public function dropSchema(CakeSchema $schema, $table = null) {
$out = '';
- foreach ($schema->tables as $curTable => $columns) {
- if (!$table || $table == $curTable) {
- $out .= 'DROP TABLE ' . $this->fullTableName($curTable) . ";\n";
- }
+ if ($table && array_key_exists($table, $schema->tables)) {
+ return $this->_dropTable($table) . "\n";
+ } elseif ($table) {
+ return $out;
+ }
+
+ foreach (array_keys($schema->tables) as $curTable) {
+ $out .= $this->_dropTable($curTable) . "\n";
}
return $out;
}
/**
+ * Generate a "drop table" statement for a single table
+ *
+ * @param type $table Name of the table to drop
+ * @return string Drop table SQL statement
+ */
+ protected function _dropTable($table) {
+ return 'DROP TABLE ' . $this->fullTableName($table) . ";";
+ }
+
+/**
* Generate a database-native column schema string
*
* @param array $column An array structured like the following: array('name' => 'value', 'type' => 'value'[, options]),
View
2  lib/Cake/Model/Model.php
@@ -1799,7 +1799,7 @@ protected function _saveMulti($joined, $id, $db) {
if ($with = $this->hasAndBelongsToMany[$assoc]['with']) {
$withModel = is_array($with) ? key($with) : $with;
- list($pluginName, $withModel) = pluginSplit($withModel);
+ list(, $withModel) = pluginSplit($withModel);
$dbMulti = $this->{$withModel}->getDataSource();
} else {
$dbMulti = $db;
View
2  lib/Cake/Network/CakeRequest.php
@@ -716,7 +716,7 @@ public function parseAccept() {
public static function acceptLanguage($language = null) {
$raw = self::_parseAcceptWithQualifier(self::header('Accept-Language'));
$accept = array();
- foreach ($raw as $qualifier => $languages) {
+ foreach ($raw as $languages) {
foreach ($languages as &$lang) {
if (strpos($lang, '_')) {
$lang = str_replace('_', '-', $lang);
View
2  lib/Cake/Network/CakeResponse.php
@@ -1261,7 +1261,7 @@ public function file($path, $options = array()) {
$httpRange = env('HTTP_RANGE');
if (isset($httpRange)) {
- list($toss, $range) = explode('=', $httpRange);
+ list(, $range) = explode('=', $httpRange);
$size = $fileSize - 1;
$length = $fileSize - $range;
View
2  lib/Cake/Routing/Router.php
@@ -326,7 +326,7 @@ public static function connect($route, $defaults = array(), $options = array())
if (strpos($options['routeClass'], '.') === false) {
$routeClass = $options['routeClass'];
} else {
- list($plugin, $routeClass) = pluginSplit($options['routeClass'], true);
+ list(, $routeClass) = pluginSplit($options['routeClass'], true);
}
$routeClass = self::_validateRouteClass($routeClass);
unset($options['routeClass']);
View
2  lib/Cake/Utility/ClassRegistry.php
@@ -110,7 +110,7 @@ public static function init($class, $strict = false) {
$count = count($objects);
$availableDs = array_keys(ConnectionManager::enumConnectionObjects());
- foreach ($objects as $key => $settings) {
+ foreach ($objects as $settings) {
if (is_numeric($settings)) {
trigger_error(__d('cake_dev', '(ClassRegistry::init() Attempted to create instance of a class with a numeric name'), E_USER_WARNING);
return false;
View
2  lib/Cake/Utility/Folder.php
@@ -211,7 +211,7 @@ public function read($sort = true, $exceptions = false, $fullPath = false) {
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::find
*/
public function find($regexpPattern = '.*', $sort = false) {
- list($dirs, $files) = $this->read($sort);
+ list(, $files) = $this->read($sort);
return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files));
}
View
3  lib/Cake/View/Helper/HtmlHelper.php
@@ -269,9 +269,8 @@ public function meta($type, $url = null, $options = array()) {
} else {
$type = array();
}
- } elseif ($url !== null) {
- $inline = $url;
}
+
$options = array_merge($type, $options);
$out = null;
View
2  lib/Cake/View/Helper/JsHelper.php
@@ -91,7 +91,7 @@ public function __construct(View $View, $settings = array()) {
$className = $settings;
}
$engineName = $className;
- list($plugin, $className) = pluginSplit($className);
+ list(, $className) = pluginSplit($className);
$this->_engineName = $className . 'Engine';
$engineClass = $engineName . 'Engine';
View
2  lib/Cake/View/JsonView.php
@@ -84,7 +84,7 @@ public function render($view = null, $layout = null) {
if (isset($this->viewVars['_serialize'])) {
return $this->_serialize($this->viewVars['_serialize']);
}
- if ($view !== false && $viewFileName = $this->_getViewFileName($view)) {
+ if ($view !== false && $this->_getViewFileName($view)) {
return parent::render($view, false);
}
}
View
2  lib/Cake/View/View.php
@@ -880,7 +880,7 @@ public function __isset($name) {
public function loadHelpers() {
$helpers = HelperCollection::normalizeObjectArray($this->helpers);
foreach ($helpers as $properties) {
- list($plugin, $class) = pluginSplit($properties['class']);
+ list(, $class) = pluginSplit($properties['class']);
$this->{$class} = $this->Helpers->load($properties['class'], $properties['settings']);
}
$this->_helpersLoaded = true;
View
2  lib/Cake/View/XmlView.php
@@ -87,7 +87,7 @@ public function render($view = null, $layout = null) {
if (isset($this->viewVars['_serialize'])) {
return $this->_serialize($this->viewVars['_serialize']);
}
- if ($view !== false && $viewFileName = $this->_getViewFileName($view)) {
+ if ($view !== false && $this->_getViewFileName($view)) {
return parent::render($view, false);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.