Skip to content

Commit 5a27158

Browse files
committed
Bump to PHP 8.1
1 parent a5ae132 commit 5a27158

File tree

91 files changed

+317
-3163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+317
-3163
lines changed

.github/workflows/tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ jobs:
1616
strategy:
1717
matrix:
1818
include:
19-
- php: '7.2'
20-
- php: '7.3'
21-
- php: '7.4'
22-
- php: '8.0'
2319
- php: '8.1'
2420
- php: '8.2'
2521
- php: '8.3'

composer.json

+4-7
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.2"
19+
"php": ">=8.1"
2020
},
2121
"require-dev": {
22-
"symfony/intl": "^5.4|^6.4",
22+
"symfony/intl": "^6.4",
2323
"symfony/phpunit-bridge": "^6.4",
24-
"symfony/var-dumper": "^5.4|^6.4"
24+
"symfony/var-dumper": "^6.4"
2525
},
2626
"replace": {
2727
"symfony/polyfill-apcu": "self.version",
@@ -64,10 +64,7 @@
6464
"src/Intl/Normalizer/Resources/stubs",
6565
"src/Php84/Resources/stubs",
6666
"src/Php83/Resources/stubs",
67-
"src/Php82/Resources/stubs",
68-
"src/Php81/Resources/stubs",
69-
"src/Php80/Resources/stubs",
70-
"src/Php73/Resources/stubs"
67+
"src/Php82/Resources/stubs"
7168
]
7269
},
7370
"minimum-stability": "dev"

phpunit

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
66
exit(1);
77
}
88
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
9-
putenv('SYMFONY_PHPUNIT_VERSION=8.5');
9+
putenv('SYMFONY_PHPUNIT_VERSION=9.6');
1010
}
1111

1212
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');

phpunit.xml.dist

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
55
colors="true"
66
bootstrap="vendor/autoload.php"
77
>
@@ -15,15 +15,15 @@
1515
</testsuite>
1616
</testsuites>
1717

18-
<filter>
19-
<whitelist>
18+
<coverage>
19+
<include>
2020
<directory>./src/</directory>
21-
<exclude>
22-
<directory>./src/*/Resources</directory>
23-
<directory>./src/*/*/Resources</directory>
24-
</exclude>
25-
</whitelist>
26-
</filter>
21+
</include>
22+
<exclude>
23+
<directory>./src/*/Resources</directory>
24+
<directory>./src/*/*/Resources</directory>
25+
</exclude>
26+
</coverage>
2727

2828
<listeners>
2929
<listener class="Symfony\Polyfill\Util\TestListener" />

src/Apcu/bootstrap.php

+9-13
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,37 @@
1515
return;
1616
}
1717

18-
if (\PHP_VERSION_ID >= 80000) {
19-
return require __DIR__.'/bootstrap80.php';
20-
}
21-
2218
if (extension_loaded('Zend Data Cache')) {
2319
if (!function_exists('apcu_add')) {
24-
function apcu_add($key, $value = null, $ttl = 0) { return p\Apcu::apcu_add($key, $value, $ttl); }
20+
function apcu_add($key, mixed $value, ?int $ttl = 0): array|bool { return p\Apcu::apcu_add($key, $value, (int) $ttl); }
2521
}
2622
if (!function_exists('apcu_delete')) {
27-
function apcu_delete($key) { return p\Apcu::apcu_delete($key); }
23+
function apcu_delete($key): array|bool { return p\Apcu::apcu_delete($key); }
2824
}
2925
if (!function_exists('apcu_exists')) {
30-
function apcu_exists($key) { return p\Apcu::apcu_exists($key); }
26+
function apcu_exists($key): array|bool { return p\Apcu::apcu_exists($key); }
3127
}
3228
if (!function_exists('apcu_fetch')) {
3329
function apcu_fetch($key, &$success = null) { return p\Apcu::apcu_fetch($key, $success); }
3430
}
3531
if (!function_exists('apcu_store')) {
36-
function apcu_store($key, $value = null, $ttl = 0) { return p\Apcu::apcu_store($key, $value, $ttl); }
32+
function apcu_store($key, mixed $value, ?int $ttl = 0): array|bool { return p\Apcu::apcu_store($key, $value, (int) $ttl); }
3733
}
3834
} else {
3935
if (!function_exists('apcu_add')) {
40-
function apcu_add($key, $value = null, $ttl = 0) { return apc_add($key, $value, $ttl); }
36+
function apcu_add($key, mixed $value, ?int $ttl = 0): array|bool { return apc_add($key, $value, (int) $ttl); }
4137
}
4238
if (!function_exists('apcu_delete')) {
43-
function apcu_delete($key) { return apc_delete($key); }
39+
function apcu_delete($key): array|bool { return apc_delete($key); }
4440
}
4541
if (!function_exists('apcu_exists')) {
46-
function apcu_exists($key) { return apc_exists($key); }
42+
function apcu_exists($key): array|bool { return apc_exists($key); }
4743
}
4844
if (!function_exists('apcu_fetch')) {
4945
function apcu_fetch($key, &$success = null) { return apc_fetch($key, $success); }
5046
}
5147
if (!function_exists('apcu_store')) {
52-
function apcu_store($key, $value = null, $ttl = 0) { return apc_store($key, $value, $ttl); }
48+
function apcu_store($key, mixed $value, ?int $ttl = 0): array|bool { return apc_store($key, $value, (int) $ttl); }
5349
}
5450
}
5551

@@ -75,7 +71,7 @@ function apcu_sma_info($limited = false) { return apc_sma_info($limited); }
7571
if (!class_exists('APCuIterator', false) && class_exists('APCIterator', false)) {
7672
class APCuIterator extends APCIterator
7773
{
78-
public function __construct($search = null, $format = \APC_ITER_ALL, $chunk_size = 100, $list = \APC_LIST_ACTIVE)
74+
public function __construct($search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE)
7975
{
8076
parent::__construct('user', $search, $format, $chunk_size, $list);
8177
}

src/Apcu/bootstrap80.php

-75
This file was deleted.

src/Apcu/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.2"
19+
"php": ">=8.1"
2020
},
2121
"autoload": {
2222
"psr-4": { "Symfony\\Polyfill\\Apcu\\": "" },

src/Ctype/Ctype.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,7 @@ private static function convert_int_to_char_for_ctype($int, $function)
219219
return (string) $int;
220220
}
221221

222-
if (\PHP_VERSION_ID >= 80100) {
223-
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
224-
}
222+
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
225223

226224
if ($int < 0) {
227225
$int += 256;

src/Ctype/bootstrap.php

+11-15
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,36 @@
1111

1212
use Symfony\Polyfill\Ctype as p;
1313

14-
if (\PHP_VERSION_ID >= 80000) {
15-
return require __DIR__.'/bootstrap80.php';
16-
}
17-
1814
if (!function_exists('ctype_alnum')) {
19-
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
15+
function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); }
2016
}
2117
if (!function_exists('ctype_alpha')) {
22-
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
18+
function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); }
2319
}
2420
if (!function_exists('ctype_cntrl')) {
25-
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
21+
function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); }
2622
}
2723
if (!function_exists('ctype_digit')) {
28-
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
24+
function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); }
2925
}
3026
if (!function_exists('ctype_graph')) {
31-
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
27+
function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); }
3228
}
3329
if (!function_exists('ctype_lower')) {
34-
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
30+
function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); }
3531
}
3632
if (!function_exists('ctype_print')) {
37-
function ctype_print($text) { return p\Ctype::ctype_print($text); }
33+
function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); }
3834
}
3935
if (!function_exists('ctype_punct')) {
40-
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
36+
function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); }
4137
}
4238
if (!function_exists('ctype_space')) {
43-
function ctype_space($text) { return p\Ctype::ctype_space($text); }
39+
function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); }
4440
}
4541
if (!function_exists('ctype_upper')) {
46-
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
42+
function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); }
4743
}
4844
if (!function_exists('ctype_xdigit')) {
49-
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
45+
function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); }
5046
}

src/Ctype/bootstrap80.php

-46
This file was deleted.

src/Ctype/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.2"
19+
"php": ">=8.1"
2020
},
2121
"provide": {
2222
"ext-ctype": "*"

src/Iconv/Iconv.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -514,14 +514,10 @@ public static function iconv_substr($s, $start, $length = 2147483647, $encoding
514514
$start += $slen;
515515
}
516516
if (0 > $start) {
517-
if (\PHP_VERSION_ID < 80000) {
518-
return false;
519-
}
520-
521517
$start = 0;
522518
}
523519
if ($start >= $slen) {
524-
return \PHP_VERSION_ID >= 80000 ? '' : false;
520+
return '';
525521
}
526522

527523
$rx = $slen - $start;
@@ -533,7 +529,7 @@ public static function iconv_substr($s, $start, $length = 2147483647, $encoding
533529
return '';
534530
}
535531
if (0 > $length) {
536-
return \PHP_VERSION_ID >= 80000 ? '' : false;
532+
return '';
537533
}
538534

539535
if ($length > $rx) {

0 commit comments

Comments
 (0)