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 compatibility #102

Open
lorenzomar opened this issue Mar 29, 2021 · 4 comments
Open

PHP 8 compatibility #102

lorenzomar opened this issue Mar 29, 2021 · 4 comments

Comments

@lorenzomar
Copy link

Hi,
is it in your roadmap a version of the library compatible with php8?

@smlawrence
Copy link

I have this running in my PHP8 application as a local copy in the project. Has there been a scope of work identified that needs to be done before the composer file can include PHP8?

@smlawrence
Copy link

Confirmed that the dev dependencies block composer install running cleanly in a PHP8 environment.

In order to run PHAN in PHP8 on the codebase I removed the dev dependencies from the composer.json, added PHAN and ran with the following config.

There were 0 issues found.

/**
 * This configuration will be read and overlaid on top of the
 * default configuration. Command-line arguments will be applied
 * after this file is read.
 */
return [
    'target_php_version' => '8.0',

    // A list of directories that should be parsed for class and
    // method information. After excluding the directories
    // defined in exclude_analysis_directory_list, the remaining
    // files will be statically analyzed for errors.
    //
    // Thus, both first-party and third-party code being used by
    // your application should be included in this list.
    'directory_list' => [
        'src',
        'vendor'
    ],
    'exclude_analysis_directory_list' => ['vendor'],

    // A regex used to match every file name that you want to
    // exclude from parsing. Actual value will exclude every
    // "test", "tests", "Test" and "Tests" folders found in
    // "vendor/" directory.
    'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',


    'plugins' => [
        'InvokePHPNativeSyntaxCheckPlugin'
    ],
    'backward_compatibility_checks' => true,
    'minimum_severity' => 10, // 10 == Issue::SEVERITY_CRITICAL
];
?>

@smlawrence
Copy link

smlawrence commented Feb 7, 2022

So summary,

  • monolog-cascade appears to have at least minimal functionality working in PHP8 based upon a live example,
  • static codebase analysis in PHAN run with a target of PHP8.0 in a PHP8.0 environment returns no issues with the codebase,
  • The dev dependencies stop the codebase from installing in PHP8 with composer install, specifically phpunit/phpcov
  • PHPUnit has been updated recently (Upgrade to PHPUnit 8.5 #103)
 Problem 1
    - phpunit/phpcov[6.0.0, ..., 6.0.1] require php ^7.2 -> your php version (8.0.13) does not satisfy that requirement.
    - Root composer.json requires phpunit/phpcov ^6.0 -> satisfiable by phpunit/phpcov[6.0.0, 6.0.1].

=> phpcov 6.1.0 is the last phpcov compatible with PHP8.X but the only phpcov that is marked as PHP8 compatible is 8.2.0 that requires PHPUnit 9.3

@smlawrence
Copy link

My bad, I presumed you were waiting to update until the entire project could run in PHP8. I didn't see properly the dev-master package and repo are >=7.X so next release is good-to-go.

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

No branches or pull requests

2 participants