Align with the commerceguys/intl changes

Created on 3 March 2023, over 1 year ago
Updated 16 November 2023, about 1 year ago

Problem/Motivation

The commerceguys/intl v2 library now specifies parameter types and return types for methods.
Drupal Commerce is going to require the v2 (See 📌 Require commerceguys/intl version 2 Fixed ).

Commerce itself is decorating the physical class, therefore we need to align with the changes in Physical too.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇱Israel jsacksick

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

Comments & Activities

  • Issue created by @jsacksick
  • Status changed to Needs review over 1 year ago
    • jsacksick committed 3bda141c on 8.x-1.x
      Issue #3345698 by jsacksick: Align with the commerceguys/intl changes.
      
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed over 1 year ago
  • 🇨🇭Switzerland berdir Switzerland

    This is a BC break, no, shouldn't this go into a new major release?

    Also, without explicit dependency/conflict declarations between this, commerce and commerceguys/intl, it is possible to update to incompatible combinations of these packages. A project I updated somehow only updated physical and not commerce/intl, so I had the latest version of physical and commerceguys/intl 1.x, resulting in this very confusing error:

    Fatal error: Declaration of CommerceGuys\Intl\Formatter\NumberFormatter::format($number, array $options = []) must be compatible with Drupal\physical\NumberFormatterInterface::format(string $number, array $options = []): string in vendor/commerceguys/intl/src/Formatter/NumberFormatter.php on line 68

    (confusing because that physical interface is only implemented in the commerce subclass that isn't mentioned here)

  • First commit to issue fork.
  • 🇨🇭Switzerland Lukas von Blarer

    I have the same issue as described in #6. I would be nice to have a fix for this soon...

  • 🇨🇭Switzerland berdir Switzerland

    There won't be a fix. Either downgrade physical back to 1.2, which is OK as this is the only change in that release or upgrade commerce. The conflict should have been added to the 1.3 release, but nothing can be done about that now.

  • 🇮🇱Israel jsacksick

    Apologize for this, I thought about adding the conflict in Commerce, but forgot to do the same here.

  • 🇬🇷Greece giorgosk Chios, Greece 🇬🇷

    For anyone still looking temp solution is

    composer require drupal/physical:1.2
    
Production build 0.71.5 2024