Skip to content

Commit 21dd558

Browse files
IonBazannicolas-grekas
authored andcommitted
[PHP 8.3] Add #[\Override] attribute
1 parent 05dfdff commit 21dd558

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Polyfills are provided for:
7070
- the `Random\CryptoSafeEngine` interface introduced in PHP 8.2;
7171
- the `Random\Engine\Secure` class introduced in PHP 8.2 (check [arokettu/random-polyfill](https://packagist.org/packages/arokettu/random-polyfill) for more engines);
7272
- the `json_validate` function introduced in PHP 8.3;
73+
- the `Override` attribute introduced in PHP 8.3;
7374

7475
It is strongly recommended to upgrade your PHP version and/or install the missing
7576
extensions whenever possible. This polyfill should be used only when there is no

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"src/Intl/Icu/Resources/stubs",
6464
"src/Intl/MessageFormatter/Resources/stubs",
6565
"src/Intl/Normalizer/Resources/stubs",
66+
"src/Php83/Resources/stubs",
6667
"src/Php82/Resources/stubs",
6768
"src/Php81/Resources/stubs",
6869
"src/Php80/Resources/stubs",

src/Php83/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Symfony Polyfill / Php83
44
This component provides features added to PHP 8.3 core:
55

66
- [`json_validate`](https://wiki.php.net/rfc/json_validate)
7+
- [`Override`](https://wiki.php.net/rfc/marking_overriden_methods)
78

89
More information can be found in the
910
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
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+
if (\PHP_VERSION_ID < 80300) {
13+
#[Attribute(Attribute::TARGET_METHOD)]
14+
final class Override
15+
{
16+
public function __construct()
17+
{
18+
}
19+
}
20+
}

src/Php83/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
},
2222
"autoload": {
2323
"psr-4": { "Symfony\\Polyfill\\Php83\\": "" },
24-
"files": [ "bootstrap.php" ]
24+
"files": [ "bootstrap.php" ],
25+
"classmap": [ "Resources/stubs" ]
2526
},
2627
"minimum-stability": "dev",
2728
"extra": {

0 commit comments

Comments
 (0)