Merge branch 'unused-vars' of https://github.com/evilbloodydemon/cakephp into evilbloodydemon-unused-vars

This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-22 16:27:14 -04:30
commit 63fd35b384
23 changed files with 9 additions and 42 deletions

View file

@ -61,7 +61,7 @@ class SchemaShell extends Shell {
*
*/
public function startup() {
$name = $file = $path = $connection = $plugin = null;
$name = $path = $connection = $plugin = null;
if (!empty($this->params['name'])) {
$name = $this->params['name'];
} elseif (!empty($this->args[0])) {

View file

@ -140,7 +140,6 @@ class FixtureTask extends BakeTask {
$this->out(sprintf("Bake Fixture\nPath: %s", $this->path));
$this->hr();
$useDbConfig = $this->connection;
if (!isset($this->connection)) {
$this->connection = $this->DbConfig->getConfig();
}

View file

@ -462,7 +462,6 @@ class ModelTask extends BakeTask {
$associations = array(
'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
);
$possibleKeys = array();
$associations = $this->findBelongsTo($model, $associations);
$associations = $this->findHasOneAndMany($model, $associations);
@ -608,8 +607,6 @@ class ModelTask extends BakeTask {
public function confirmAssociations($model, $associations) {
foreach ($associations as $type => $settings) {
if (!empty($associations[$type])) {
$count = count($associations[$type]);
$response = 'y';
foreach ($associations[$type] as $i => $assoc) {
$prompt = "{$model->name} {$type} {$assoc['alias']}?";
$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?'));
$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias );
$suggestedForeignKey = null;
if ($assocType == 0) {
$showKeys = $possibleKeys[$model->table];

View file

@ -50,8 +50,6 @@ class PluginTask extends Shell {
* @return void
*/
public function execute() {
$plugin = null;
if (isset($this->args[0])) {
$plugin = Inflector::camelize($this->args[0]);
$pluginPath = $this->_pluginPath($plugin);

View file

@ -106,7 +106,6 @@ class TemplateTask extends Shell {
* @return void
*/
public function set($one, $two = null) {
$data = null;
if (is_array($one)) {
if (is_array($two)) {
$data = array_combine($one, $two);

View file

@ -106,7 +106,7 @@ class ViewTask extends BakeTask {
if (!isset($this->connection)) {
$this->connection = 'default';
}
$controller = $action = $alias = null;
$action = null;
$this->controllerName = $this->_controllerName($this->args[0]);
$this->controllerPath = $this->_controllerPath($this->controllerName);

View file

@ -58,7 +58,6 @@ class TaskCollection extends ObjectCollection {
if (isset($this->_loaded[$name])) {
return $this->_loaded[$name];
}
$taskFile = Inflector::underscore($name);
$taskClass = $name . 'Task';
App::uses($taskClass, $plugin . 'Console/Command/Task');
if (!class_exists($taskClass)) {

View file

@ -308,9 +308,6 @@ class DbAcl extends Object implements AclInterface {
return false;
}
$aroNode = $aroPath[0];
$acoNode = $acoPath[0];
if ($action != '*' && !in_array('_' . $action, $permKeys)) {
trigger_error(__d('cake_dev', "ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
return false;

View file

@ -565,7 +565,6 @@ class RequestHandlerComponent extends Component {
$defaults = array('index' => null, 'charset' => null, 'attachment' => false);
$options = $options + $defaults;
$cType = null;
if (strpos($type, '/') === false) {
$cType = $this->response->getMimeType($type);
if ($cType === false) {

View file

@ -732,8 +732,6 @@ class Controller extends Object {
* @link http://book.cakephp.org/view/979/set
*/
public function set($one, $two = null) {
$data = array();
if (is_array($one)) {
if (is_array($two)) {
$data = array_combine($one, $two);

View file

@ -323,9 +323,6 @@ class App {
}
}
$mergeExclude = array('Lib', 'locales', 'vendors', 'plugins');
$appLibs = empty($paths['Lib']) ? $defaults['Lib'] : $paths['Lib'];
foreach ($defaults as $type => $default) {
if (empty(self::$__packages[$type]) || empty($paths)) {
self::$__packages[$type] = $default;
@ -417,7 +414,6 @@ class App {
* @return mixed Either false on incorrect / miss. Or an array of found objects.
*/
public static function objects($type, $path = null, $cache = true) {
$objects = array();
$extension = '/\.php$/';
$includeDirectories = false;
$name = $type;
@ -457,8 +453,6 @@ class App {
$path = self::path($type, $plugin);
}
$items = array();
foreach ((array)$path as $dir) {
if ($dir != APP && is_dir($dir)) {
$files = new RegexIterator(new DirectoryIterator($dir), $extension);
@ -599,7 +593,7 @@ class App {
* @return boolean true if Class is already in memory or if file is found and loaded, false if not
*/
public static function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) {
$ext = $plugin = $directory = null;
$ext = null;
if (is_array($type)) {
extract($type, EXTR_OVERWRITE);

View file

@ -772,7 +772,6 @@ class Multibyte {
$length = count($utf8Map);
$lowerCase = array();
$matched = false;
for ($i = 0 ; $i < $length; $i++) {
$char = $utf8Map[$i];
@ -819,7 +818,6 @@ class Multibyte {
$utf8Map = Multibyte::utf8($string);
$length = count($utf8Map);
$matched = false;
$replaced = array();
$upperCase = array();
@ -947,7 +945,6 @@ class Multibyte {
}
$string = Multibyte::utf8($string);
$stringCount = count($string);
for ($i = 1; $i <= $start; $i++) {
unset($string[$i - 1]);
@ -1068,7 +1065,6 @@ class Multibyte {
* @return array
*/
private static function __find($char, $type = 'lower') {
$value = false;
$found = array();
if (!isset(self::$__codeRange[$char])) {
$range = self::__codepoint($char);

View file

@ -573,7 +573,6 @@ class CakeResponse {
return array_map(array($this, 'mapType'), $ctype);
}
$keys = array_keys($this->_mimeTypes);
$count = count($keys);
foreach ($this->_mimeTypes as $alias => $types) {
if (is_array($types) && in_array($ctype, $types)) {

View file

@ -350,7 +350,6 @@ class HttpResponse implements ArrayAccess {
if ($hex == false) {
return $escape;
}
$regexChars = '';
foreach ($escape as $key => $char) {
$escape[$key] = '\\x' . str_pad(dechex(ord($char)), 2, '0', STR_PAD_LEFT);
}

View file

@ -917,7 +917,6 @@ class HttpSocket extends CakeSocket {
if ($hex == false) {
return $escape;
}
$regexChars = '';
foreach ($escape as $key => $char) {
$escape[$key] = '\\x' . str_pad(dechex(ord($char)), 2, '0', STR_PAD_LEFT);
}

View file

@ -299,7 +299,6 @@ class Dispatcher {
include WWW_ROOT . DS . $filters['js'];
return true;
}
$controller = null;
$pathSegments = explode('.', $url);
$ext = array_pop($pathSegments);
$parts = explode('/', $url);

View file

@ -399,7 +399,7 @@ class CakeRoute {
$greedyNamed = $namedConfig['greedyNamed'];
$allowedNamedParams = $namedConfig['rules'];
$named = $pass = $_query = array();
$named = $pass = array();
foreach ($url as $key => $value) {

View file

@ -487,7 +487,7 @@ class Router {
'named' => array()
);
$r = $ext = null;
$ext = null;
if ($url && strpos($url, '/') !== 0) {
$url = '/' . $url;
@ -771,7 +771,7 @@ class Router {
* @return string Full translated URL with base path.
*/
public static function url($url = null, $full = false) {
$defaults = $params = array('plugin' => null, 'controller' => null, 'action' => 'index');
$params = array('plugin' => null, 'controller' => null, 'action' => 'index');
if (is_bool($full)) {
$escape = false;
@ -792,7 +792,7 @@ class Router {
}
$base = $path['base'];
$extension = $output = $mapped = $q = $frag = null;
$extension = $output = $q = $frag = null;
if (empty($url)) {
$output = isset($path['here']) ? $path['here'] : '/';

View file

@ -93,7 +93,7 @@ class ClassRegistry {
*/
public static function &init($class, $type = null) {
$_this = ClassRegistry::getInstance();
$id = $false = false;
$false = false;
$true = true;
if (!$type) {

View file

@ -274,7 +274,6 @@ class Debugger {
break;
}
$helpCode = null;
if (!empty($_this->helpPath) && preg_match('/.*\[([0-9]+)\]$/', $description, $codes)) {
if (isset($codes[1])) {
$helpID = $codes[1];
@ -418,7 +417,7 @@ class Debugger {
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
public static function excerpt($file, $line, $context = 2) {
$data = $lines = array();
$lines = array();
if (!file_exists($file)) {
return array();
}

View file

@ -415,7 +415,6 @@ class Set {
$matches[] = $context;
continue;
}
$match = false;
if ($token === '@*' && is_array($context['item'])) {
$matches[] = array(
'trace' => array_merge($context['trace'], (array)$key),

View file

@ -33,7 +33,6 @@ class String {
*/
public static function uuid() {
$node = env('SERVER_ADDR');
$pid = null;
if (strpos($node, ':') !== false) {
if (substr_count($node, '::')) {

View file

@ -194,7 +194,6 @@ class Xml {
$value = '';
}
$isNamespace = strpos($key, 'xmlns:');
$nsUri = null;
if ($isNamespace !== false) {
$node->setAttributeNS('http://www.w3.org/2000/xmlns/', $key, $value);
continue;