Permalink
Browse files

remove unused local vars

  • Loading branch information...
1 parent 51946ff commit 16be9d499094b1effad9ab61a80c28fa06438587 @ceeram ceeram committed Jan 23, 2013
Showing with 132 additions and 169 deletions.
  1. +2 −2 lib/Cake/Console/Command/Task/TestTask.php
  2. +1 −1 lib/Cake/Model/Datasource/DboSource.php
  3. +1 −1 lib/Cake/Model/Model.php
  4. +2 −2 lib/Cake/Test/Case/Cache/CacheTest.php
  5. +1 −1 lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
  6. +1 −0 lib/Cake/Test/Case/Console/Command/AclShellTest.php
  7. +1 −1 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  8. +1 −1 lib/Cake/Test/Case/Console/Command/Task/DbConfigTaskTest.php
  9. +1 −1 lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php
  10. +1 −1 lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php
  11. +1 −1 lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php
  12. +1 −1 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  13. +2 −2 lib/Cake/Test/Case/Console/ConsoleOptionParserTest.php
  14. +4 −7 lib/Cake/Test/Case/Console/ShellTest.php
  15. +1 −1 lib/Cake/Test/Case/Console/TaskCollectionTest.php
  16. +1 −1 lib/Cake/Test/Case/Controller/Component/Acl/DbAclTest.php
  17. +0 −1 lib/Cake/Test/Case/Controller/Component/Acl/PhpAclTest.php
  18. +1 −1 lib/Cake/Test/Case/Controller/Component/AclComponentTest.php
  19. +1 −1 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  20. +2 −2 lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php
  21. +1 −1 lib/Cake/Test/Case/Controller/ScaffoldTest.php
  22. +1 −1 lib/Cake/Test/Case/Core/ConfigureTest.php
  23. +1 −1 lib/Cake/Test/Case/Core/ObjectTest.php
  24. +1 −1 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  25. +1 −1 lib/Cake/Test/Case/Log/CakeLogTest.php
  26. +4 −4 lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php
  27. +3 −20 lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
  28. +1 −3 lib/Cake/Test/Case/Model/CakeSchemaTest.php
  29. +2 −3 lib/Cake/Test/Case/Model/ConnectionManagerTest.php
  30. +3 −3 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
  31. +0 −1 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
  32. +11 −9 lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php
  33. +7 −2 lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
  34. +1 −1 lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php
  35. +0 −2 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
  36. +2 −3 lib/Cake/Test/Case/Model/ModelReadTest.php
  37. +1 −1 lib/Cake/Test/Case/Model/ModelValidationTest.php
  38. +2 −8 lib/Cake/Test/Case/Model/ModelWriteTest.php
  39. +0 −5 lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php
  40. +3 −4 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
  41. +1 −1 lib/Cake/Test/Case/Network/Http/HttpResponseTest.php
  42. +8 −8 lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
  43. +1 −1 lib/Cake/Test/Case/Routing/DispatcherTest.php
  44. +1 −1 lib/Cake/Test/Case/Routing/RouterTest.php
  45. +3 −3 lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
  46. +1 −1 lib/Cake/Test/Case/Utility/CakeNumberTest.php
  47. +1 −1 lib/Cake/Test/Case/Utility/ClassRegistryTest.php
  48. +1 −1 lib/Cake/Test/Case/Utility/DebuggerTest.php
  49. +0 −2 lib/Cake/Test/Case/Utility/FileTest.php
  50. +2 −2 lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
  51. +6 −6 lib/Cake/Test/Case/Utility/SecurityTest.php
  52. +1 −1 lib/Cake/Test/Case/Utility/XmlTest.php
  53. +2 −2 lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
  54. +2 −2 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  55. +4 −4 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  56. +2 −2 lib/Cake/Test/Case/View/Helper/JsHelperTest.php
  57. +3 −3 lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
  58. +2 −2 lib/Cake/Test/Case/View/HelperCollectionTest.php
  59. +3 −3 lib/Cake/Test/Case/View/ScaffoldViewTest.php
  60. +2 −2 lib/Cake/Test/Case/View/ThemeViewTest.php
  61. +4 −4 lib/Cake/Test/Case/View/ViewTest.php
  62. +1 −1 lib/Cake/TestSuite/CakeTestSuite.php
  63. +0 −1 lib/Cake/TestSuite/CakeTestSuiteCommand.php
  64. +1 −1 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
  65. +1 −1 lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
  66. +1 −1 lib/Cake/TestSuite/Fixture/CakeTestFixture.php
  67. +1 −1 lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
  68. +1 −1 lib/Cake/TestSuite/Reporter/CakeTextReporter.php
  69. +1 −1 lib/Cake/Utility/ClassRegistry.php
  70. +4 −6 lib/Cake/Utility/String.php
@@ -398,7 +398,7 @@ protected function _processModel($subject) {
}
if ($type == 'hasAndBelongsToMany') {
if (!empty($subject->hasAndBelongsToMany[$alias]['with'])) {
- list($plugin, $joinModel) = pluginSplit($subject->hasAndBelongsToMany[$alias]['with']);
+ list(, $joinModel) = pluginSplit($subject->hasAndBelongsToMany[$alias]['with']);
} else {
$joinModel = Inflector::classify($subject->hasAndBelongsToMany[$alias]['joinTable']);
}
@@ -423,7 +423,7 @@ protected function _processController($subject) {
$models = $subject->uses;
}
foreach ($models as $model) {
- list($plugin, $model) = pluginSplit($model);
+ list(, $model) = pluginSplit($model);
$this->_processModel($subject->{$model});
}
}
@@ -2448,7 +2448,7 @@ public function conditionKeysToString($conditions, $quoteValues = true, $model =
if (is_numeric($key) && empty($value)) {
continue;
} elseif (is_numeric($key) && is_string($value)) {
- $out[] = $not . $this->_quoteFields($value);
+ $out[] = $this->_quoteFields($value);
} elseif ((is_numeric($key) && is_array($value)) || in_array(strtolower(trim($key)), $bool)) {
if (in_array(strtolower(trim($key)), $bool)) {
$join = ' ' . strtoupper($key) . ' ';
@@ -1609,7 +1609,7 @@ public function save($data = null, $validate = true, $fieldList = array()) {
$fields = array();
if (!is_array($validate)) {
- $options = array_merge($defaults, compact('validate', 'fieldList', 'callbacks'));
+ $options = array_merge($defaults, compact('validate', 'fieldList'));
} else {
$options = array_merge($defaults, $validate);
}
@@ -136,7 +136,7 @@ public function testInvalidConfig() {
'serialize' => true,
'random' => 'wii'
));
- $read = Cache::read('Test', 'invalid');
+ Cache::read('Test', 'invalid');
}
/**
@@ -402,7 +402,7 @@ public function testSet() {
Cache::delete('test_cache');
- $global = Cache::settings();
+ Cache::settings();
Cache::set($_cacheSet);
}
@@ -181,7 +181,7 @@ public function testSerialize() {
$newread = Cache::read('serialize_test', 'file_test');
- $delete = Cache::delete('serialize_test', 'file_test');
+ Cache::delete('serialize_test', 'file_test');
$this->assertSame($read, serialize($data));
@@ -115,6 +115,7 @@ public function testViewWithArgument() {
public function testParsingModelAndForeignKey() {
$result = $this->Task->parseIdentifier('Model.foreignKey');
$expected = array('model' => 'Model', 'foreign_key' => 'foreignKey');
+ $this->assertEquals($expected, $result);
$result = $this->Task->parseIdentifier('mySuperUser');
$this->assertEquals('mySuperUser', $result);
@@ -294,7 +294,7 @@ public function testGenerateNoOverwrite() {
$this->Shell->Schema->path = TMP;
$this->Shell->Schema->expects($this->never())->method('read');
- $result = $this->Shell->generate();
+ $this->Shell->generate();
unlink(TMP . 'schema.php');
}
@@ -128,6 +128,6 @@ public function testExecuteIntoInteractive() {
)
));
- $result = $this->Task->execute();
+ $this->Task->execute();
}
}
@@ -49,7 +49,7 @@ public function setUp() {
array($out, $out, $in)
);
$this->path = TMP . 'tests' . DS . 'extract_task_test';
- $Folder = new Folder($this->path . DS . 'locale', true);
+ new Folder($this->path . DS . 'locale', true);
}
/**
@@ -381,7 +381,7 @@ public function testGeneratePluginFixtureFile() {
$this->Task->expects($this->at(0))->method('createFile')
->with($filename, $this->stringContains('class Article'));
- $result = $this->Task->generateFixtureFile('Article', array());
+ $this->Task->generateFixtureFile('Article', array());
CakePlugin::unload();
}
@@ -173,7 +173,7 @@ public function testGetNameWithOutOfBoundsOption() {
$this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls(99, 1));
$this->Task->expects($this->once())->method('err');
- $result = $this->Task->getName('test');
+ $this->Task->getName('test');
}
/**
@@ -349,7 +349,7 @@ public function testRegistryClearWhenBuildingTestObjects() {
));
$keys = ClassRegistry::keys();
$this->assertTrue(in_array('test_task_comment', $keys));
- $object = $this->Task->buildTestSubject('Model', 'TestTaskComment');
+ $this->Task->buildTestSubject('Model', 'TestTaskComment');
$keys = ClassRegistry::keys();
$this->assertFalse(in_array('random', $keys));
@@ -259,7 +259,7 @@ public function testOptionThatDoesNotExist() {
$parser = new ConsoleOptionParser('test', false);
$parser->addOption('no-commit', array('boolean' => true));
- $result = $parser->parse(array('--fail', 'other'));
+ $parser->parse(array('--fail', 'other'));
}
/**
@@ -271,7 +271,7 @@ public function testShortOptionThatDoesNotExist() {
$parser = new ConsoleOptionParser('test', false);
$parser->addOption('no-commit', array('boolean' => true));
- $result = $parser->parse(array('-f'));
+ $parser->parse(array('-f'));
}
/**
@@ -545,7 +545,7 @@ public function testCreateFileNonInteractive() {
$path = TMP . 'shell_test';
$file = $path . DS . 'file1.php';
- $Folder = new Folder($path, true);
+ new Folder($path, true);
$this->Shell->interactive = false;
@@ -572,7 +572,7 @@ public function testCreateFileInteractive() {
$path = TMP . 'shell_test';
$file = $path . DS . 'file1.php';
- $Folder = new Folder($path, true);
+ new Folder($path, true);
$this->Shell->interactive = true;
@@ -663,7 +663,6 @@ public function testHasMethod() {
* @return void
*/
public function testRunCommandMain() {
- $methods = get_class_methods('Shell');
$Mock = $this->getMock('Shell', array('main', 'startup'), array(), '', false);
$Mock->expects($this->once())->method('main')->will($this->returnValue(true));
@@ -677,7 +676,6 @@ public function testRunCommandMain() {
* @return void
*/
public function testRunCommandWithMethod() {
- $methods = get_class_methods('Shell');
$Mock = $this->getMock('Shell', array('hit_me', 'startup'), array(), '', false);
$Mock->expects($this->once())->method('hit_me')->will($this->returnValue(true));
@@ -700,7 +698,7 @@ public function testRunCommandBaseclassMethod() {
$Mock->expects($this->never())->method('hr');
$Mock->expects($this->once())->method('out');
- $result = $Mock->runCommand('hr', array());
+ $Mock->runCommand('hr', array());
}
/**
@@ -709,7 +707,6 @@ public function testRunCommandBaseclassMethod() {
* @return void
*/
public function testRunCommandMissingMethod() {
- $methods = get_class_methods('Shell');
$Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false);
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);
@@ -762,7 +759,7 @@ public function testRunCommandHittingTask() {
$Shell->RunCommand = $task;
- $result = $Shell->runCommand('run_command', array('run_command', 'one', 'value'));
+ $Shell->runCommand('run_command', array('run_command', 'one', 'value'));
}
/**
@@ -78,7 +78,7 @@ public function testLoadWithEnableFalse() {
* @return void
*/
public function testLoadMissingTask() {
- $result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
+ $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
}
/**
@@ -521,7 +521,7 @@ protected function _debug($printTreesToo = false) {
$values = array_map(array(&$this, '_pad'), $values);
$permissions[$key] = implode (' ', $values);
}
- $permisssions = array_map(array(&$this, '_pad'), $permissions);
+ $permissions = array_map(array(&$this, '_pad'), $permissions);
array_unshift($permissions, 'Current Permissions :');
if ($printTreesToo) {
debug(array('aros' => $this->Acl->Aro->generateTreeList(), 'acos' => $this->Acl->Aco->generateTreeList()));
@@ -59,7 +59,6 @@ public function testAddRole() {
}
public function testAroResolve() {
- $map = $this->Acl->Aro->map;
$this->Acl->Aro->map = array(
'User' => 'FooModel/nickname',
'Role' => 'FooModel/role',
@@ -61,7 +61,7 @@ public function tearDown() {
public function testConstrutorException() {
Configure::write('Acl.classname', 'AclClassNameThatDoesNotExist');
$Collection = new ComponentCollection();
- $acl = new AclComponent($Collection);
+ new AclComponent($Collection);
}
/**
@@ -848,7 +848,7 @@ public function testBeforeRedirectCallingHeader() {
ob_start();
$RequestHandler->beforeRedirect($controller, 'request_handler_test/param_method/first/second', 403);
- $result = ob_get_clean();
+ ob_get_clean();
}
/**
@@ -732,7 +732,7 @@ public function testValidatePostCheckbox() {
$this->Controller->Security->startup($this->Controller);
$key = $this->Controller->request->params['_Token']['key'];
- $this->Controller->request->data = $data = array(
+ $this->Controller->request->data = array(
'Model' => array('username' => '', 'password' => '', 'valid' => '0'),
'_Token' => compact('key', 'fields', 'unlocked')
);
@@ -1174,7 +1174,7 @@ public function testCsrfSettingMultipleNonces() {
$token = $this->Security->Session->read('_Token');
$this->assertEquals(2, count($token['csrfTokens']), 'Missing the csrf token.');
- foreach ($token['csrfTokens'] as $key => $expires) {
+ foreach ($token['csrfTokens'] as $expires) {
$diff = $csrfExpires - $expires;
$this->assertTrue($diff === 0 || $diff === 1, 'Token expiry does not match');
}
@@ -230,7 +230,7 @@ public function testScaffoldChangingViewProperty() {
$this->Controller->theme = 'TestTheme';
$this->Controller->viewClass = 'Theme';
$this->Controller->constructClasses();
- $Scaffold = new TestScaffoldMock($this->Controller, $this->Controller->request);
+ new TestScaffoldMock($this->Controller, $this->Controller->request);
$this->assertEquals('Scaffold', $this->Controller->viewClass);
}
@@ -239,7 +239,7 @@ public function testCheckEmpty() {
*/
public function testLoadExceptionOnNonExistantFile() {
Configure::config('test', new PhpReader());
- $result = Configure::load('non_existing_configuration_file', 'test');
+ Configure::load('non_existing_configuration_file', 'test');
}
/**
@@ -105,7 +105,7 @@ public function return_here() {
* @return void
*/
public function paginate_request_action() {
- $data = $this->paginate();
+ $this->paginate();
return true;
}
@@ -497,7 +497,7 @@ public function testExceptionResponseHeader() {
$ExceptionRenderer->controller->response->expects($this->at(1))->method('_sendHeader')->with('Allow', 'POST, DELETE');
ob_start();
$ExceptionRenderer->render();
- $result = ob_get_clean();
+ ob_get_clean();
}
/**
@@ -654,7 +654,7 @@ public function testCustomLevelWrites() {
$this->_deleteLogs();
$this->_resetLogConfig();
- $levels = CakeLog::levels(array('spam', 'eggs'));
+ CakeLog::levels(array('spam', 'eggs'));
$testMessage = 'error message';
CakeLog::write('error', $testMessage);
@@ -152,7 +152,7 @@ public function testContainments() {
* @return void
*/
public function testInvalidContainments() {
- $r = $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
+ $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
}
/**
@@ -162,7 +162,7 @@ public function testInvalidContainments() {
*/
public function testInvalidContainmentsNoNotices() {
$this->Article->Behaviors->attach('Containable', array('notices' => false));
- $r = $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
+ $this->_containments($this->Article, array('Comment', 'InvalidBinding'));
}
/**
@@ -243,7 +243,7 @@ public function testBeforeFind() {
* @return void
*/
public function testBeforeFindWithNonExistingBinding() {
- $r = $this->Article->find('all', array('contain' => array('Comment' => 'NonExistingBinding')));
+ $this->Article->find('all', array('contain' => array('Comment' => 'NonExistingBinding')));
}
/**
@@ -3252,7 +3252,7 @@ public function testOriginalAssociations() {
$firstResult = $this->Article->Comment->find('all', $options);
- $dummyResult = $this->Article->Comment->find('all', array(
+ $this->Article->Comment->find('all', array(
'conditions' => array(
'User.user' => 'mariano'
),
Oops, something went wrong.

0 comments on commit 16be9d4

Please sign in to comment.