Skip to content

Commit 7062851

Browse files
committed
support PHP 8.5, drop support for PHP 8.1
1 parent 3f4900b commit 7062851

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
php: [ '8.1', '8.2', '8.3', '8.4' ]
18+
php: [ '8.2', '8.3', '8.4', '8.5' ]
1919
latte: [ '', '--prefer-lowest' ]
2020
exclude:
21-
- php: '8.4'
21+
- php: '8.5'
2222
latte: '--prefer-lowest'
2323
fail-fast: false
2424
steps:
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/checkout@v4
3939
- uses: shivammathur/setup-php@v2
4040
with:
41-
php-version: '8.4'
41+
php-version: '8.5'
4242
extensions: curl, iconv, json, mbstring, tokenizer
4343
coverage: pcov
4444
- run: composer install --no-interaction
@@ -51,7 +51,7 @@ jobs:
5151
- uses: actions/checkout@v4
5252
- uses: shivammathur/setup-php@v2
5353
with:
54-
php-version: '8.4'
54+
php-version: '8.5'
5555
coverage: none
5656
- run: composer install --no-interaction
5757
- run: make phpstan
@@ -62,7 +62,7 @@ jobs:
6262
- uses: actions/checkout@v4
6363
- uses: shivammathur/setup-php@v2
6464
with:
65-
php-version: '8.4'
65+
php-version: '8.5'
6666
coverage: none
6767
- run: composer install --no-interaction
6868
- run: make cs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"issues": "https://github.com/contributte/webpack/issues"
2121
},
2222
"require": {
23-
"php": ">=8.1",
23+
"php": ">=8.2",
2424
"ext-curl": "*",
2525
"nette/di": "^3.0"
2626
},

src/DevServer/Http/CurlClient.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ public function isAvailable(string $url, float $timeout): bool
2323
return false;
2424
}
2525

26+
$output = \fopen('php://temp', 'w+');
27+
\assert($output !== false);
28+
2629
\curl_setopt_array($curl, [
2730
\CURLOPT_CUSTOMREQUEST => 'GET',
2831
\CURLOPT_PROTOCOLS => \CURLPROTO_HTTP | \CURLPROTO_HTTPS,
2932

3033
// no output please
3134
\CURLOPT_RETURNTRANSFER => false,
3235
\CURLOPT_HEADER => false,
33-
\CURLOPT_FILE => \fopen('php://temp', 'w+'),
36+
\CURLOPT_FILE => $output,
3437

3538
// setup timeout; this requires NOSIGNAL for values below 1s
36-
\CURLOPT_TIMEOUT_MS => $timeout * 1000,
39+
\CURLOPT_TIMEOUT_MS => (int) $timeout * 1000,
3740
\CURLOPT_NOSIGNAL => $timeout < 1 && \PHP_OS_FAMILY !== 'Windows',
3841

3942
// allow self-signed certificates
@@ -44,7 +47,6 @@ public function isAvailable(string $url, float $timeout): bool
4447
\curl_exec($curl);
4548
$error = \curl_error($curl);
4649

47-
\curl_close($curl);
4850
return $error === '';
4951
}
5052
}

src/Manifest/ManifestLoader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function loadManifest(string $fileName): array
4242
\CURLOPT_FAILONERROR => true,
4343

4444
// setup timeout; this requires NOSIGNAL for values below 1s
45-
\CURLOPT_TIMEOUT_MS => $this->timeout * 1000,
45+
\CURLOPT_TIMEOUT_MS => (int) $this->timeout * 1000,
4646
\CURLOPT_NOSIGNAL => $this->timeout < 1 && \PHP_OS_FAMILY !== 'Windows',
4747

4848
// allow self-signed certificates
@@ -55,8 +55,6 @@ public function loadManifest(string $fileName): array
5555
if ($manifest === false) {
5656
$errorMessage = \curl_error($ch);
5757
}
58-
59-
\curl_close($ch);
6058
}
6159
}
6260

tests/DI/WebpackExtensionTest.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ final class WebpackExtensionTest extends TestCase
9999

100100
$refl = new \ReflectionClass($resolver);
101101
$cache = $refl->getProperty('resolutions');
102-
$cache->setAccessible(true);
103102

104103
Assert::same(['asset.js' => 'cached.resolved.asset.js'], $cache->getValue($resolver));
105104
}

0 commit comments

Comments
 (0)