File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ private function detectUnmatchedLineEndings(array $diff): bool
182
182
return false ;
183
183
}
184
184
185
- private function getLinebreak ($ line ): string
185
+ private function getLinebreak (int | string $ line ): string
186
186
{
187
187
if (!is_string ($ line )) {
188
188
return '' ;
Original file line number Diff line number Diff line change @@ -127,8 +127,10 @@ public function getDiff(array $diff): string
127
127
: $ diff ;
128
128
}
129
129
130
- private function writeDiffHunks ($ output , array $ diff ): void
130
+ private function writeDiffHunks (mixed $ output , array $ diff ): void
131
131
{
132
+ assert (is_resource ($ output ));
133
+
132
134
// detect "No newline at end of file" and insert into `$diff` if needed
133
135
134
136
$ upperLimit = count ($ diff );
@@ -278,8 +280,10 @@ private function writeHunk(
278
280
int $ fromRange ,
279
281
int $ toStart ,
280
282
int $ toRange ,
281
- $ output
283
+ mixed $ output
282
284
): void {
285
+ assert (is_resource ($ output ));
286
+
283
287
fwrite ($ output , '@@ - ' . $ fromStart );
284
288
285
289
if (!$ this ->collapseRanges || 1 !== $ fromRange ) {
Original file line number Diff line number Diff line change @@ -75,8 +75,10 @@ public function getDiff(array $diff): string
75
75
: $ diff ;
76
76
}
77
77
78
- private function writeDiffHunks ($ output , array $ diff ): void
78
+ private function writeDiffHunks (mixed $ output , array $ diff ): void
79
79
{
80
+ assert (is_resource ($ output ));
81
+
80
82
// detect "No newline at end of file" and insert into `$diff` if needed
81
83
82
84
$ upperLimit = count ($ diff );
@@ -224,8 +226,10 @@ private function writeHunk(
224
226
int $ fromRange ,
225
227
int $ toStart ,
226
228
int $ toRange ,
227
- $ output
229
+ mixed $ output
228
230
): void {
231
+ assert (is_resource ($ output ));
232
+
229
233
if ($ this ->addLineNumbers ) {
230
234
fwrite ($ output , '@@ - ' . $ fromStart );
231
235
You can’t perform that action at this time.
0 commit comments