Add use of PHP 8 features

Created on 18 October 2024, 3 months ago

Problem/Motivation

Created from a comment ✨ Use queue for sending emails Needs review and should cover point 1.
The goal of this issue is to add support for PHP 8 features wherever possible.

πŸ“Œ Task
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

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

Merge Requests

Comments & Activities

  • Issue created by @marchuk.vitaliy
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    A new branch "3481620-add-use-of" has been opened with fixes for PHP 8 features, but I don't think it's finished yet. Need to spend time on additional fixes and testing.

  • Pipeline finished with Failed
    3 months ago
    Total: 355s
    #313300
  • πŸ‡³πŸ‡±Netherlands megachriz

    Thanks for your work so far! I see that you removed properties from AbandonedCartMail and AbandonedCarts. Was that intentional?

  • πŸ‡³πŸ‡±Netherlands megachriz

    I see that you removed properties from AbandonedCartMail and AbandonedCarts. Was that intentional?

    Ah, I see now that the properties are not removed, but are defined in the constructor instead:

      public function __construct(
        protected Connection $connection,
        ConfigFactoryInterface $config_factory,
        QueueFactory $queue_factory,
        protected ModuleHandlerInterface $moduleHandler,
        protected TimeInterface $time,
        protected LoggerInterface $logger
      )
    

    I'm not used to this pattern yet, but I agree it is the modern way forward.

  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    @megachriz

    Yeah, this is "Constructor property promotion". Since this module is not that big, it makes sense to refactor everything possible to support all PHP 8 features.

Production build 0.71.5 2024