Fix LinkyCheckerMemoryLogger::log return declaration for psr/log v3.0.0

Created on 9 March 2023, over 1 year ago
Updated 10 March 2023, over 1 year ago

Problem/Motivation

https://github.com/php-fig/log/pull/77 introduced a void return type in v3.0.0. Drupal 10 bumps prs/log from 1.x to 3.x. As a result in D10 there's a fatal in LinkyCheckerMemoryLogger::log()

Proposed resolution

Add the return type. As the LoggerInterface previously didn't have a return type, adding it in our overridden LinkyCheckerMemoryLogger shouldn't be an issue for BC with 1.x of psr/log. I.e. it'll be compatible with D9 and D10.

📌 Task
Status

Fixed

Version

2.2

Component

Code

Created by

🇦🇺Australia fenstrat Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fenstrat
  • @fenstrat opened merge request.
  • 🇦🇺Australia fenstrat Australia

    Not sure what's going on that with test run failure. Will look again later, he's the change in patch format for now.

  • Status changed to Needs review over 1 year ago
  • 🇦🇺Australia fenstrat Australia

    This time with an actual patch!

  • Status changed to Needs work over 1 year ago
  • 🇦🇺Australia dpi Perth, Australia

    I think we're missing coverage here.

    A few issues.

    Linkychecker presently supports D8 and up. We should explicitely make 9.5 minimum

    Linkychecker has minimum of PHP 7.1, \Stringable is a PHP8.0 feature.

    We cant introduce the parameter change as it will break with psr/log 1, of which Drupal 9.5 requires.

    Core constraints only allow psr/log ^1.1, so we cannot force the psr/log 3 change

    I think we have to make a release split between D9 + D10.

  • 🇦🇺Australia dpi Perth, Australia

    I'm all for a minimum D10+PHP8.0 constraint change + dedicated major or minor versioning to support the changes required to satisfy this issue.

  • Status changed to Needs review over 1 year ago
  • 🇦🇺Australia fenstrat Australia

    Good point about \Stringable being php8.0+

    In the MR I've bumped php to 8.1+ (as D10 already requires that) and the core_version_requirement: ^10. So this can go into a new 3.x branch.

    As for coverage, yep, we are indeed missing that. There's no existing functional that's doing any checking (or rechecking which is where we hit this fatal), so it'll need that the crawler service swapped out as a minimum. Bit to it, happy to take a look, but might make sense in a follow up?

  • 🇦🇺Australia dpi Perth, Australia
  • 🇦🇺Australia dpi Perth, Australia

    Introduced 2.1 for D9 support, in case we need to go back and fix anything. but id consider it locked for new dev.

    Introduced 2.2 for D10 min support, which this PR is now based off.

    I couldnt rationalise a v3 yet.

  • 🇦🇺Australia dpi Perth, Australia
  • Status changed to Fixed over 1 year ago
  • 🇦🇺Australia dpi Perth, Australia

    As found in 2.2.0

  • 🇦🇺Australia fenstrat Australia

    Thank you kind sir!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024