Skip to content

Commit d90febf

Browse files
committed
Add docs in ExportedArrayDiffer.
1 parent 81e8b62 commit d90febf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Diff/ExportedArrayDiffer.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ public function compare(array $before, array $after): array {
3838
return $diff;
3939
}
4040

41+
/**
42+
* Compares two values.
43+
*
44+
* @param mixed $before
45+
* @param mixed $after
46+
* @param bool $could_be_list
47+
*
48+
* @return array|false
49+
* FALSE if the values are completely different.
50+
* Empty array, if the values are identical.
51+
* Otherwise, a non-empty array with diff information.
52+
*/
4153
protected function compareValues(mixed $before, mixed $after, bool $could_be_list = true): array|false {
4254
if ($before === $after) {
4355
return [];
@@ -48,6 +60,20 @@ protected function compareValues(mixed $before, mixed $after, bool $could_be_lis
4860
return $this->compareArrays($before, $after, $could_be_list);
4961
}
5062

63+
/**
64+
* Compares two exported arrays.
65+
*
66+
* Note that these arrays could be the result of an object export.
67+
*
68+
* @param array $before
69+
* @param array $after
70+
* @param bool $could_be_list
71+
*
72+
* @return array|false
73+
* FALSE if the values are completely different or from different objects.
74+
* Empty array, if the values are identical.
75+
* Otherwise, a non-empty array with diff information.
76+
*/
5177
protected function compareArrays(array $before, array $after, bool $could_be_list = true): array|false {
5278
if ($could_be_list && array_is_list($before) && array_is_list($after)) {
5379
return $this->compareLists($before, $after);

0 commit comments

Comments
 (0)