Skip to content

Commit

Permalink
initialize PHP 8.3 support (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Dec 31, 2023
1 parent 952e06c commit e51a37c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

**PHP CompatInfo** is a library that can find the minimum version and the extensions required for a piece of code to run.

Running on PHP greater or equal than 7.2 for parsing source code in a format PHP 5.2 to PHP 8.2
Running on PHP greater or equal than 7.2 for parsing source code in a format PHP 5.2 to PHP 8.3

## Versions

Expand Down
23 changes: 23 additions & 0 deletions config/set/php83.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php declare(strict_types=1);
/**
* This file is part of the PHP_CompatInfo package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

/**
* Build the Container with PHP 8.3 features detection
*
* @author Laurent Laville
* @since Release 7.1.0
*/
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();

$services->defaults()
->autowire()
;
};
20 changes: 20 additions & 0 deletions config/set/up-to-php83.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php declare(strict_types=1);
/**
* This file is part of the PHP_CompatInfo package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

/**
* Build the Container with PHP features detection up to version 8.3
*
* @author Laurent Laville
* @since Release 7.1.0
*/
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/up-to-php82.php');
$containerConfigurator->import(__DIR__ . '/php83.php');
};
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
**PHP CompatInfo** is a library that
can find the minimum version and the extensions required for a piece of code to run.

Running on PHP greater or equal than 8.0 for parsing source code in a format PHP 5.2 to PHP 8.2
Running on PHP greater or equal than 8.0 for parsing source code in a format PHP 5.2 to PHP 8.3

![Graph Composer](./assets/images/graph-composer.svg)

## Features

- Parse source code in format PHP 5.2 to PHP 8.2
- Parse source code in format PHP 5.2 to PHP 8.3
- Detect PHP features for each Major/minor versions
- Detect versions of all directives, constants, functions, classes, interfaces of 100 extensions and more
- Display/Inspect list of extensions, and their versions supported
Expand Down
5 changes: 5 additions & 0 deletions docs/components/sniffs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ Here is the list of features supported and their corresponding sniffs :
[AllowNullFalseTrueAsStandaloneTypes]: https://wiki.php.net/rfc/true-type
[DeprecateDollarBraceStringInterpolation]: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

## [PHP 8.3](https://www.php.net/manual/en/migration83.php)

| Sniff category | Sniff class name | PHP Feature |
|----------------------|----------------------------------------------|-----------------------------------------------------------------------------------------|

## Special cases

* **Namespaces** declaration have no sniff, because its detected by the `VersionResolverVisitor`
Expand Down

0 comments on commit e51a37c

Please sign in to comment.