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.2 not supported #6764

Closed
flashlabs opened this issue Jan 25, 2023 · 12 comments
Closed

PHP 8.2 not supported #6764

flashlabs opened this issue Jan 25, 2023 · 12 comments
Labels

Comments

@flashlabs
Copy link

Bug report

Description

PHP CS Fixer is not working with PHP 8.2.*

Runtime version

PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.
Current PHP version: 8.2.1.
To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`.
If you use PHP version higher than supported, you may experience code modified in a wrong way.
Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer .

Used command

vendor/bin/php-cs-fixer

Configuration file

<?php

declare(strict_types=1);

$finder = (new PhpCsFixer\Finder())
    ->in(__DIR__.'/src')
    ->in(__DIR__.'/tests')
    ->in(__DIR__.'/config')
    ->in(__DIR__.'/migrations')
;

return (new PhpCsFixer\Config())
    ->setRules([
        '@PHP82Migration' => true,
        '@Symfony' => true,
        '@Symfony:risky' => true,
        'array_syntax' => ['syntax' => 'short'],
        'blank_line_before_statement' => [
            'statements' => ['break', 'continue', 'declare', 'exit', 'goto', 'return', 'throw', 'try'],
        ],
        'declare_strict_types' => true,
        'no_php4_constructor' => true,
        'no_useless_concat_operator' => true,
        'no_useless_else' => true,
        'no_useless_return' => true,
        'phpdoc_order' => true,
        'phpdoc_order_by_value' => true,
        'strict_comparison' => true,
        'strict_param' => true,
    ])
    ->setRiskyAllowed(true)
    ->setFinder($finder)
;

Code snippet that reproduces the problem

n/a

@no-simpler
Copy link

I’m also surprised that PHP 8.2 is not yet supported, but I don’t think it’s a bug: there still are open issues on this topic.

Last time I searched, php-cs-fixer does not explicitly declare the supported PHP versions in its documentation. However, composer.json states "php": "^7.4 || ^8.0", which should probably be changed to "php": "^7.4 || 8.0.* || 8.1.*",.

@flashlabs
Copy link
Author

I’m also surprised that PHP 8.2 is not yet supported, but I don’t think it’s a bug: there still are open issues on this topic.

This was the best category I could choose from the suggested ones in the "New issue" form.

I know that there's no explicit declaration of supported versions, but since there's a stable PHP 8.2 I was expecting php-cs-fixer to work with that one.

There's also another blocker regarding the php-cs-fixer, which is "doctrine/annotations": "^1.14.1" and annotations are already in 2.* version, but that's a different story 😅

Anyway, fingers crossed for quick fixes on those bugs you mentioned 🤞

@keradus
Copy link
Member

keradus commented Jan 26, 2023

Folks, highly encouraging to use the search feature.
TL;DR - 8,2 is not currently supported as it takes huge effort to support each new PHP syntax. If you need it, consider to support the project [eg with code contribution].
ref #6714 (comment)

@keradus keradus closed this as completed Jan 26, 2023
@bocharsky-bw
Copy link
Contributor

@keradus is there any simple way to know which PHP version is currently supported by PHP CS Fixer? I don't see this info in the main README file, what do you think about adding this? I think it would help to avoid most (some) reported issues about unsupported PHP version

@keradus
Copy link
Member

keradus commented Jan 31, 2023

it;s fair, @bocharsky-bw
I think now it's only in runtime or source ( https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/php-cs-fixer#L31 ).

if you like to, could you suggest a PR adding this note?

@bocharsky-bw
Copy link
Contributor

@keradus Thanks! How about #6768 ?

@keradus
Copy link
Member

keradus commented Jan 31, 2023

Let's move the discussion to PR then, thanks for picking up!

@dozer111
Copy link

dozer111 commented Feb 8, 2023

@keradus have u a milestone, or sth like this about what tasks(goals) must be closed to support 8.2?

@keradus
Copy link
Member

keradus commented Feb 8, 2023

This is what we identified so far, but not sure if all is identified already
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues?q=is%3Aissue+is%3Aopen+8.2+label%3Atopic%2FPHP8.2

@stof
Copy link
Contributor

stof commented Jun 12, 2023

@keradus as all those issues are not closed, is there any reason not to mark PHP 8.2 as supported ?

@Wirone
Copy link
Member

Wirone commented Jun 12, 2023

@stof what do you mean? PHP 8.2 is supported. Error described in the initial comment currently is visible for PHP 8.3.

@stof
Copy link
Contributor

stof commented Jun 12, 2023

ah sorry, I missed the fact that the async-aws project was not using the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants