Europe/London
Dec 2025
Career
2 min read

Migrating a PrestaShop store to PHP 8.2 without breaking production

Forty deprecation warnings, two breaking changes, and one Yoco payment integration. Here's how we got it done.

The client had a PrestaShop 1.7 store running PHP 7.4. They needed to move to PHP 8.2 and integrate a new payment gateway (Yoco) without taking the store offline during peak season. Here's how we did it.

The deprecation audit

PHP 8.2 removed several things that PHP 7.x silently allowed: dynamic properties, certain string interpolation patterns, and some PCRE regex behaviours. The first step was running the Rector static analysis tool to find everything that needed changing before touching production.

# Install Rector
composer require rector/rector --dev

# Run in dry-run mode first
./vendor/bin/rector process src --dry-run

Rector flagged 43 issues across the custom modules. Most were dynamic property declarations — easily fixed by adding explicit property declarations to classes. A handful were more complex regex patterns that needed manual review.

Don't skip the dry run. Rector modifies files in place. Running it without --dry-run on a codebase without tests is a fast way to introduce subtle bugs. Review every change it proposes before applying.

Yoco payment integration

Yoco's API is REST-based with a straightforward charge flow. The integration involved a custom PrestaShop payment module with three endpoints: checkout redirect, webhook for async payment confirmation, and a refund handler.

class YocoPayment extends PaymentModule {
  public function hookPaymentOptions($params): array {
    $option = new PaymentOption();
    $option->setModuleName($this->name)
           ->setCallToActionText('Pay with Yoco')
           ->setAction($this->context->link->getModuleLink(
               $this->name, 'checkout', [], true
           ));
    return [$option];
  }
}

Zero-downtime deployment

We staged the PHP 8.2 migration on a separate server, ran the full test suite, then did a DNS cutover during a 2am low-traffic window. Total downtime: under 4 minutes. The Yoco integration went live the following week after a 48-hour parallel testing period.