Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP 8.3] Add #[\Override] attribute #434

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Polyfills are provided for:
- the `Random\CryptoSafeEngine` interface introduced in PHP 8.2;
- the `Random\Engine\Secure` class introduced in PHP 8.2 (check [arokettu/random-polyfill](https://packagist.org/packages/arokettu/random-polyfill) for more engines);
- the `json_validate` function introduced in PHP 8.3;
- the `Override` attribute introduced in PHP 8.3;

It is strongly recommended to upgrade your PHP version and/or install the missing
extensions whenever possible. This polyfill should be used only when there is no
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"src/Intl/Icu/Resources/stubs",
"src/Intl/MessageFormatter/Resources/stubs",
"src/Intl/Normalizer/Resources/stubs",
"src/Php83/Resources/stubs",
"src/Php82/Resources/stubs",
"src/Php81/Resources/stubs",
"src/Php80/Resources/stubs",
Expand Down
1 change: 1 addition & 0 deletions src/Php83/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Symfony Polyfill / Php83
This component provides features added to PHP 8.3 core:

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

More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
Expand Down
20 changes: 20 additions & 0 deletions src/Php83/Resources/stubs/Override.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

if (\PHP_VERSION_ID < 80300) {
#[Attribute(Attribute::TARGET_METHOD)]
final class Override
{
public function __construct()
IonBazan marked this conversation as resolved.
Show resolved Hide resolved
{
}
}
}
3 changes: 2 additions & 1 deletion src/Php83/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Php83\\": "" },
"files": [ "bootstrap.php" ]
"files": [ "bootstrap.php" ],
"classmap": [ "Resources/stubs" ]
},
"minimum-stability": "dev",
"extra": {
Expand Down
Loading