Skip to content

Commit 15994e6

Browse files
Copilotswissspidy
andcommitted
Use sebastian/diff v3 for PHP 7.2+ compatibility
Co-authored-by: swissspidy <[email protected]>
1 parent 511948a commit 15994e6

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"phpstan/phpstan-deprecation-rules": "^1.2 || ^2.0",
2121
"phpstan/phpstan-phpunit": "^1.4 || ^2.0",
2222
"phpstan/phpstan-strict-rules": "^1.6 || ^2.0",
23-
"sebastian/diff": "^4.0 || ^5.0 || ^6.0 || ^7.0",
23+
"sebastian/diff": "^3.0",
2424
"swissspidy/phpstan-no-private": "^0.2.1 || ^1.0",
2525
"szepeviktor/phpstan-wordpress": "^v1.3.5",
2626
"wp-cli/config-command": "^1 || ^2",

src/Context/Support.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Exception;
1010
use Mustangostang\Spyc;
1111
use SebastianBergmann\Diff\Differ;
12-
use SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
1312

1413
trait Support {
1514

@@ -316,11 +315,7 @@ protected function check_that_yaml_string_contains_yaml_string( $actual_yaml, $e
316315
* @return string The unified diff output.
317316
*/
318317
protected function generate_diff( string $expected, string $actual ): string {
319-
$builder = new UnifiedDiffOutputBuilder(
320-
"--- Expected\n+++ Actual\n",
321-
false
322-
);
323-
$differ = new Differ( $builder );
318+
$differ = new Differ( "--- Expected\n+++ Actual\n" );
324319
return $differ->diff( $expected, $actual );
325320
}
326321
}

0 commit comments

Comments
 (0)