Skip to content

Commit f2d3939

Browse files
Fix deprecation
1 parent 843a2c9 commit f2d3939

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Fixable/Patcher.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public function applyDiffs(string $fileName, array $diffs): string
6262

6363
$refMerge = new ReflectionClass(PhpMerge::class);
6464
$refMergeMethod = $refMerge->getMethod('mergeHunks');
65-
$refMergeMethod->setAccessible(true);
65+
if (PHP_VERSION_ID < 80100) {
66+
$refMergeMethod->setAccessible(true);
67+
}
6668

6769
$result = Line::createArray(array_map(
6870
static fn ($l) => [$l, Differ::OLD],

src/Testing/TestCaseSourceLocatorFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public function create(): SourceLocator
6868
),
6969
];
7070
$vendorDirProperty = $classLoaderReflection->getProperty('vendorDir');
71-
$vendorDirProperty->setAccessible(true);
71+
if (PHP_VERSION_ID < 80100) {
72+
$vendorDirProperty->setAccessible(true);
73+
}
7274
foreach ($classLoaders as $classLoader) {
7375
$composerProjectPath = dirname($vendorDirProperty->getValue($classLoader));
7476
if (!is_file($composerProjectPath . '/composer.json')) {

0 commit comments

Comments
 (0)