Permalink
Browse files

Fix coding standards warnings.

  • Loading branch information...
1 parent 9f9feec commit a4f0399f744ee22b8b2f0e1c60ac31cbe5099aec @markstory markstory committed Apr 11, 2012
Showing with 23 additions and 23 deletions.
  1. +20 −20 lib/Cake/Test/Case/Utility/HashTest.php
  2. +3 −3 lib/Cake/Utility/Set.php
@@ -1984,38 +1984,38 @@ public function testMissingParent() {
* @return void
*/
public function testMergeDiff() {
- $array1 = array(
+ $first = array(
'ModelOne' => array(
'id' => 1001,
'field_one' => 'a1.m1.f1',
'field_two' => 'a1.m1.f2'
)
);
- $array2 = array(
+ $second = array(
'ModelTwo' => array(
'id' => 1002,
'field_one' => 'a2.m2.f1',
'field_two' => 'a2.m2.f2'
)
);
- $result = Hash::mergeDiff($array1, $array2);
- $this->assertEquals($result, $array1 + $array2);
+ $result = Hash::mergeDiff($first, $second);
+ $this->assertEquals($result, $first + $second);
- $result = Hash::mergeDiff($array1, array());
- $this->assertEquals($result, $array1);
+ $result = Hash::mergeDiff($first, array());
+ $this->assertEquals($result, $first);
- $result = Hash::mergeDiff(array(), $array1);
- $this->assertEquals($result, $array1);
+ $result = Hash::mergeDiff(array(), $first);
+ $this->assertEquals($result, $first);
- $array3 = array(
+ $third = array(
'ModelOne' => array(
'id' => 1003,
'field_one' => 'a3.m1.f1',
'field_two' => 'a3.m1.f2',
'field_three' => 'a3.m1.f3'
)
);
- $result = Hash::mergeDiff($array1, $array3);
+ $result = Hash::mergeDiff($first, $third);
$expected = array(
'ModelOne' => array(
'id' => 1001,
@@ -2026,19 +2026,19 @@ public function testMergeDiff() {
);
$this->assertEquals($expected, $result);
- $array1 = array(
+ $first = array(
0 => array('ModelOne' => array('id' => 1001, 'field_one' => 's1.0.m1.f1', 'field_two' => 's1.0.m1.f2')),
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's1.1.m2.f2', 'field_two' => 's1.1.m2.f2'))
);
- $array2 = array(
+ $second = array(
0 => array('ModelOne' => array('id' => 1001, 'field_one' => 's2.0.m1.f1', 'field_two' => 's2.0.m1.f2')),
1 => array('ModelTwo' => array('id' => 1002, 'field_one' => 's2.1.m2.f2', 'field_two' => 's2.1.m2.f2'))
);
- $result = Hash::mergeDiff($array1, $array2);
- $this->assertEquals($result, $array1);
+ $result = Hash::mergeDiff($first, $second);
+ $this->assertEquals($result, $first);
- $array3 = array(
+ $third = array(
0 => array(
'ModelThree' => array(
'id' => 1003,
@@ -2048,7 +2048,7 @@ public function testMergeDiff() {
)
);
- $result = Hash::mergeDiff($array1, $array3);
+ $result = Hash::mergeDiff($first, $third);
$expected = array(
0 => array(
'ModelOne' => array(
@@ -2072,11 +2072,11 @@ public function testMergeDiff() {
);
$this->assertEquals($expected, $result);
- $result = Hash::mergeDiff($array1, null);
- $this->assertEquals($result, $array1);
+ $result = Hash::mergeDiff($first, null);
+ $this->assertEquals($result, $first);
- $result = Hash::mergeDiff($array1, $array2);
- $this->assertEquals($result, $array1 + $array2);
+ $result = Hash::mergeDiff($first, $second);
+ $this->assertEquals($result, $first + $second);
}
/**
View
@@ -38,12 +38,12 @@ class Set {
* Note: This function will work with an unlimited amount of arguments and typecasts non-array
* parameters into arrays.
*
- * @param array $arr1 Array to be merged
- * @param array $arr2 Array to merge with
+ * @param array $data Array to be merged
+ * @param array $merge Array to merge with
* @return array Merged array
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::merge
*/
- public static function merge($arr1, $arr2 = null) {
+ public static function merge($data, $merge = null) {
$args = func_get_args();
if (empty($args[1])) {
return (array)$args[0];

0 comments on commit a4f0399

Please sign in to comment.