Skip to content

Commit 6512aa1

Browse files
minor #462 [PHP 8.4] Add initial stubs (Ayesh)
This PR was merged into the 1.x branch. Discussion ---------- [PHP 8.4] Add initial stubs - Adds PHP 8.4 polyfill for splits - Enables PHP 8.4 in GitHub Actions tests This is also to prepare for #458 to add new `mb_trim`, `mb_ltrim`, and `mb_rtrim` functions, which will be a separate PR. Commits ------- 8cb84ad [PHP 8.4] Add initial stubs
2 parents 69d3c46 + 8cb84ad commit 6512aa1

File tree

10 files changed

+128
-0
lines changed

10 files changed

+128
-0
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- php: '8.1'
2626
- php: '8.2'
2727
- php: '8.3'
28+
- php: '8.4'
2829
fail-fast: false
2930

3031
steps:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ should **not** `require` the `symfony/polyfill` package, but the standalone ones
9898
- `symfony/polyfill-php81` for using the PHP 8.1 functions,
9999
- `symfony/polyfill-php82` for using the PHP 8.2 functions,
100100
- `symfony/polyfill-php83` for using the PHP 8.3 functions,
101+
- `symfony/polyfill-php84` for using the PHP 8.4 functions,
101102
- `symfony/polyfill-iconv` for using the iconv functions,
102103
- `symfony/polyfill-intl-grapheme` for using the `grapheme_*` functions,
103104
- `symfony/polyfill-intl-idn` for using the `idn_to_ascii` and `idn_to_utf8` functions,

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"symfony/polyfill-php81": "self.version",
3434
"symfony/polyfill-php82": "self.version",
3535
"symfony/polyfill-php83": "self.version",
36+
"symfony/polyfill-php84": "self.version",
3637
"symfony/polyfill-iconv": "self.version",
3738
"symfony/polyfill-intl-grapheme": "self.version",
3839
"symfony/polyfill-intl-icu": "self.version",

src/Php84/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024-present Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

src/Php84/Php84.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Polyfill\Php84;
13+
14+
/**
15+
* @author Ayesh Karunaratne <ayesh@aye.sh>
16+
*
17+
* @internal
18+
*/
19+
final class Php84
20+
{
21+
}

src/Php84/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Symfony Polyfill / Php84
2+
========================
3+
4+
This component provides features added to PHP 8.4 core:
5+
6+
More information can be found in the
7+
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
8+
9+
License
10+
=======
11+
12+
This library is released under the [MIT license](LICENSE).

src/Php84/bootstrap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\Polyfill\Php84 as p;
13+
14+
if (\PHP_VERSION_ID >= 80400) {
15+
return;
16+
}

src/Php84/composer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "symfony/polyfill-php84",
3+
"type": "library",
4+
"description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions",
5+
"keywords": ["polyfill", "shim", "compatibility", "portable"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "p@tchwork.com"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": ">=7.1"
20+
},
21+
"autoload": {
22+
"psr-4": { "Symfony\\Polyfill\\Php84\\": "" },
23+
"files": [ "bootstrap.php" ]
24+
},
25+
"minimum-stability": "dev",
26+
"extra": {
27+
"branch-alias": {
28+
"dev-main": "1.30-dev"
29+
},
30+
"thanks": {
31+
"name": "symfony/polyfill",
32+
"url": "https://github.com/symfony/polyfill"
33+
}
34+
}
35+
}

src/bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@
3636
if (\PHP_VERSION_ID < 80300) {
3737
require __DIR__.'/Php83/bootstrap.php';
3838
}
39+
40+
if (\PHP_VERSION_ID < 80400) {
41+
require __DIR__.'/Php84/bootstrap.php';
42+
}

tests/Php84/Php84Test.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Polyfill\Tests\Php84;
13+
14+
use PHPUnit\Framework\TestCase;
15+
16+
class Php84Test extends TestCase
17+
{
18+
}

0 commit comments

Comments
 (0)