Skip to content

Commit 0f3c844

Browse files
authored
Merge pull request #989 from IonBazan/feature/php85
Fix PHP 8.5 deprecations
2 parents 0d09a61 + c2fb0e6 commit 0f3c844

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
12-
php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4]
12+
php: [8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.4]
1313
dependency-version: [prefer-lowest, prefer-stable]
1414

1515
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Configure for PHP 8.4
4242
run: composer require "rector/rector:2.*" --no-interaction --no-update
43-
if: matrix.php == '8.4' && matrix.dependency-version == 'prefer-lowest'
43+
if: matrix.php >= '8.4' && matrix.dependency-version == 'prefer-lowest'
4444

4545
- name: Install dependencies
4646
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

src/Settings/SettingsFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function getSettingsFromConfigFile(?string $configDirectory = null): arra
3939

4040
protected function searchConfigFiles(?string $configDirectory = null): string
4141
{
42+
$configDirectory ??= '';
4243
if (! isset(self::$cache[$configDirectory])) {
4344
self::$cache[$configDirectory] = $this->searchConfigFilesOnDisk($configDirectory);
4445
}

src/Support/Invador.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public function __get(string $name): Ray
2222
{
2323
$property = $this->reflected->getProperty($name);
2424

25-
$property->setAccessible(true);
25+
if (PHP_VERSION_ID < 80100) {
26+
$property->setAccessible(true);
27+
}
2628

2729
$value = $property->getValue($this->obj);
2830

@@ -33,7 +35,9 @@ public function __call(string $name, array $params = []): Ray
3335
{
3436
$method = $this->reflected->getMethod($name);
3537

36-
$method->setAccessible(true);
38+
if (PHP_VERSION_ID < 80100) {
39+
$method->setAccessible(true);
40+
}
3741

3842
$result = $method->invoke($this->obj, ...$params);
3943

0 commit comments

Comments
 (0)