Browse Source

Merge pull request #5138 from bcrowe/3.0-table

3.0 - Remove unnecessary var declaration
Mark Story 11 years ago
parent
commit
ddb9eb814a
2 changed files with 3 additions and 4 deletions
  1. 1 2
      src/ORM/Table.php
  2. 2 2
      tests/TestCase/ORM/TableTest.php

+ 1 - 2
src/ORM/Table.php

@@ -1528,7 +1528,6 @@ class Table implements RepositoryInterface, EventListenerInterface {
 			$fields = substr($method, strlen($matches[0]));
 			$findType = Inflector::variable($matches[1]);
 		}
-		$conditions = [];
 		$hasOr = strpos($fields, '_or_');
 		$hasAnd = strpos($fields, '_and_');
 
@@ -1536,7 +1535,7 @@ class Table implements RepositoryInterface, EventListenerInterface {
 			$conditions = [];
 			if (count($args) < count($fields)) {
 				throw new BadMethodCallException(sprintf(
-					'Not enough arguments to magic finder. Got %s required %s',
+					'Not enough arguments for magic finder. Got %s required %s',
 					count($args),
 					count($fields)
 				));

+ 2 - 2
tests/TestCase/ORM/TableTest.php

@@ -2278,7 +2278,7 @@ class TableTest extends TestCase {
  * Test magic findByXX errors on missing arguments.
  *
  * @expectedException \BadMethodCallException
- * @expectedExceptionMessage Not enough arguments to magic finder. Got 0 required 1
+ * @expectedExceptionMessage Not enough arguments for magic finder. Got 0 required 1
  * @return void
  */
 	public function testMagicFindError() {
@@ -2291,7 +2291,7 @@ class TableTest extends TestCase {
  * Test magic findByXX errors on missing arguments.
  *
  * @expectedException \BadMethodCallException
- * @expectedExceptionMessage Not enough arguments to magic finder. Got 1 required 2
+ * @expectedExceptionMessage Not enough arguments for magic finder. Got 1 required 2
  * @return void
  */
 	public function testMagicFindErrorMissingField() {