@@ -49,7 +49,7 @@ public function getResultForIdenticalsDefault(): string
4949 *
5050 * @param Differ $differ the differ object
5151 *
52- * @return array generated changes, suitable for presentation in HTML
52+ * @return array[][] generated changes, suitable for presentation in HTML
5353 */
5454 public function getChanges (Differ $ differ ): array
5555 {
@@ -62,14 +62,14 @@ public function getChanges(Differ $differ): array
6262 $ old = $ differ ->getOld ();
6363 $ new = $ differ ->getNew ();
6464
65- $ hunks = [];
65+ $ changes = [];
6666
67- foreach ($ differ ->getGroupedOpcodes () as $ opcodes ) {
68- $ hunk = [];
67+ foreach ($ differ ->getGroupedOpcodes () as $ hunk ) {
68+ $ change = [];
6969 $ lastOp = SequenceMatcher::OP_NOP ;
7070 $ lastBlock = 0 ;
7171
72- foreach ($ opcodes as [$ op , $ i1 , $ i2 , $ j1 , $ j2 ]) {
72+ foreach ($ hunk as [$ op , $ i1 , $ i2 , $ j1 , $ j2 ]) {
7373 // if there are same amount of lines replaced
7474 // we can render the inner detailed changes with corresponding lines
7575 if ($ op === SequenceMatcher::OP_REP && $ i2 - $ i1 === $ j2 - $ j1 ) {
@@ -79,8 +79,8 @@ public function getChanges(Differ $differ): array
7979 }
8080
8181 if ($ op !== $ lastOp ) {
82- $ hunk [] = $ this ->getDefaultBlock ($ op , $ i1 , $ j1 );
83- $ lastBlock = \count ($ hunk ) - 1 ;
82+ $ change [] = $ this ->getDefaultBlock ($ op , $ i1 , $ j1 );
83+ $ lastBlock = \count ($ change ) - 1 ;
8484 }
8585
8686 $ lastOp = $ op ;
@@ -90,9 +90,9 @@ public function getChanges(Differ $differ): array
9090 // the old and the new may not be exactly the same
9191 // because of ignoreCase, ignoreWhitespace, etc
9292 $ lines = \array_slice ($ old , $ i1 , $ i2 - $ i1 );
93- $ hunk [$ lastBlock ]['old ' ]['lines ' ] = $ this ->formatLines ($ lines );
93+ $ change [$ lastBlock ]['old ' ]['lines ' ] = $ this ->formatLines ($ lines );
9494 $ lines = \array_slice ($ new , $ j1 , $ j2 - $ j1 );
95- $ hunk [$ lastBlock ]['new ' ]['lines ' ] = $ this ->formatLines ($ lines );
95+ $ change [$ lastBlock ]['new ' ]['lines ' ] = $ this ->formatLines ($ lines );
9696
9797 continue ;
9898 }
@@ -106,7 +106,7 @@ public function getChanges(Differ $differ): array
106106 $ lines
107107 );
108108
109- $ hunk [$ lastBlock ]['old ' ]['lines ' ] = $ lines ;
109+ $ change [$ lastBlock ]['old ' ]['lines ' ] = $ lines ;
110110 }
111111
112112 if ($ op & (SequenceMatcher::OP_REP | SequenceMatcher::OP_INS )) {
@@ -118,14 +118,14 @@ public function getChanges(Differ $differ): array
118118 $ lines
119119 );
120120
121- $ hunk [$ lastBlock ]['new ' ]['lines ' ] = $ lines ;
121+ $ change [$ lastBlock ]['new ' ]['lines ' ] = $ lines ;
122122 }
123123 }
124124
125- $ hunks [] = $ hunk ;
125+ $ changes [] = $ change ;
126126 }
127127
128- return $ hunks ;
128+ return $ changes ;
129129 }
130130
131131 /**
@@ -149,7 +149,7 @@ protected function renderArrayWorker(array $differArray): string
149149 /**
150150 * Render the array of changes.
151151 *
152- * @param array $changes the changes
152+ * @param array[][] $changes the changes
153153 *
154154 * @todo rename typo to renderChanges() in v7
155155 */
@@ -320,7 +320,7 @@ function (array $matches): string {
320320 *
321321 * Internally, we would like always int form for better performance.
322322 *
323- * @param array $changes the changes
323+ * @param array[][] $changes the changes
324324 */
325325 protected function ensureChangesUseIntTag (array &$ changes ): void
326326 {
0 commit comments