From e6823cc0bfa2574e039095f85a9848de9bc1bea8 Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 09:48:53 +0100 Subject: [PATCH 01/17] fix --- .github/workflows/php.yml | 154 +++++++++++++------- README.md | 2 +- ps_googleanalytics.php | 2 +- tests/{phpstan => php}/index.php | 12 +- tests/php/phpstan/index.php | 34 +++++ tests/{ => php}/phpstan/phpstan-1.7.7.neon | 0 tests/{ => php}/phpstan/phpstan-1.7.8.neon | 0 tests/{ => php}/phpstan/phpstan-8.0.neon | 0 tests/php/phpstan/phpstan-8.1.7.neon | 8 + tests/php/phpstan/phpstan-8.2.x.neon | 8 + tests/php/phpstan/phpstan-9.0.x.neon | 8 + tests/php/phpstan/phpstan-9.1.x.neon | 8 + tests/php/phpstan/phpstan-develop.neon | 8 + tests/{ => php}/phpstan/phpstan-latest.neon | 0 tests/php/phpstan/phpstan.neon | 2 + tests/php/phpstan/prepend-constants.php | 11 ++ tests/phpstan.sh | 28 ---- tests/phpstan/phpstan.neon | 10 -- 18 files changed, 198 insertions(+), 97 deletions(-) rename tests/{phpstan => php}/index.php (69%) create mode 100644 tests/php/phpstan/index.php rename tests/{ => php}/phpstan/phpstan-1.7.7.neon (100%) rename tests/{ => php}/phpstan/phpstan-1.7.8.neon (100%) rename tests/{ => php}/phpstan/phpstan-8.0.neon (100%) create mode 100644 tests/php/phpstan/phpstan-8.1.7.neon create mode 100644 tests/php/phpstan/phpstan-8.2.x.neon create mode 100644 tests/php/phpstan/phpstan-9.0.x.neon create mode 100644 tests/php/phpstan/phpstan-9.1.x.neon create mode 100644 tests/php/phpstan/phpstan-develop.neon rename tests/{ => php}/phpstan/phpstan-latest.neon (100%) create mode 100644 tests/php/phpstan/phpstan.neon create mode 100644 tests/php/phpstan/prepend-constants.php delete mode 100755 tests/phpstan.sh delete mode 100644 tests/phpstan/phpstan.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f820d74c..ced8bcbb 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,89 +1,135 @@ name: PHP tests on: [push, pull_request] jobs: - # Check there is no syntax errors in the project php-linter: - name: PHP Syntax check 7.1 => 8.1 + name: PHP Syntax check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.1.0 - - - name: PHP syntax checker 7.1 - uses: prestashop/github-action-php-lint/7.1@master + uses: actions/checkout@v6 - name: PHP syntax checker 7.2 uses: prestashop/github-action-php-lint/7.2@master - - name: PHP syntax checker 7.3 - uses: prestashop/github-action-php-lint/7.3@master - - name: PHP syntax checker 7.4 uses: prestashop/github-action-php-lint/7.4@master - name: PHP syntax checker 8.0 uses: prestashop/github-action-php-lint/8.0@master - - name: PHP syntax checker 8.1 - uses: prestashop/github-action-php-lint/8.1@master + - name: PHP syntax checker 8.5 + uses: prestashop/github-action-php-lint/8.5@master # Check the PHP code follow the coding standards php-cs-fixer: name: PHP-CS-Fixer runs-on: ubuntu-latest steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Run PHP-CS-Fixer + uses: PrestaShop/.github/.github/actions/php-ci/php-cs@master with: php-version: '7.4' - - name: Checkout - uses: actions/checkout@v3.1.0 - - - name: Cache dependencies - uses: actions/cache@v3 + # Run PHPStan against the module (PHP 7.4 – 8.1) + phpstan-74: + name: PHPStan (PHP 7.4 - 8.1) + runs-on: ubuntu-latest + strategy: + matrix: + presta_version: ['8.1.7', '8.2.x'] + php_version: ['7.4', '8.1'] + fail-fast: false + env: + PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini + steps: + - name: Checkout repository + uses: actions/checkout@v6 with: - path: vendor - key: php-${{ hashFiles('composer.lock') }} - - - name: Install dependencies - run: composer install - - - name: Run PHP-CS-Fixer - run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff - - # Run PHPStan against the module and a PrestaShop release - phpstan: - name: PHPStan + path: ${{ github.event.repository.name }} + + - name: Prepare PHP env for PrestaShop 8 (define constants before any bootstrap) + run: | + mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini + { + echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php" + echo "memory_limit=512M" + } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini + + - name: Run PHPStan + uses: Touxten/.github/.github/actions/php-ci/phpstan@master + with: + php-version: ${{ matrix.php_version }} + presta-version: ${{ matrix.presta_version }} + module-name: ${{ github.event.repository.name }} + phpstan-level: '5' + phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon + phpstan-version: '^0.12' + composer-version: '2.2.18' + + # Run PHPStan against the module (PHP 8.1 – 8.4) + phpstan-80-84: + name: PHPStan (PHP 8.1 - 8.4 ) runs-on: ubuntu-latest strategy: matrix: - presta-versions: ['1.7.7', '1.7.8', '8.0', 'latest'] + presta_version: ['9.0.x'] + php_version: ['8.1', '8.4'] + fail-fast: false + env: + PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Checkout repository + uses: actions/checkout@v6 with: - php-version: '7.4' - - - name: Checkout - uses: actions/checkout@v3.1.0 - - # Add vendor folder in cache to make next builds faster - - name: Cache vendor folder - uses: actions/cache@v3 + path: ${{ github.event.repository.name }} + + - name: Prepare PHP env for PrestaShop 9.0.x (define constants before any bootstrap) + run: | + mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini + { + echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php" + echo "memory_limit=512M" + } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini + + - name: Run PHPStan + uses: Touxten/.github/.github/actions/php-ci/phpstan@master with: - path: vendor - key: php-${{ hashFiles('composer.lock') }} + php-version: ${{ matrix.php_version }} + presta-version: ${{ matrix.presta_version }} + module-name: ${{ github.event.repository.name }} + phpstan-level: '5' + phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon - # Add composer local folder in cache to make next builds faster - - name: Cache composer folder - uses: actions/cache@v3 + # Run PHPStan against the module (PHP 8.1 – 8.5) + phpstan: + name: PHPStan (PHP 8.1 - 8.5) + runs-on: ubuntu-latest + strategy: + matrix: + presta_version: ['9.1.x', 'develop'] + php_version: ['8.1', '8.5'] + fail-fast: false + env: + PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini + steps: + - name: Checkout repository + uses: actions/checkout@v6 with: - path: ~/.composer/cache - key: php-composer-cache - - - run: composer install - - # Docker images prestashop/prestashop may be used, even if the shop remains uninstalled - - name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }}) - run: ./tests/phpstan.sh ${{ matrix.presta-versions }} + path: ${{ github.event.repository.name }} + + - name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap) + run: | + mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini + { + echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php" + echo "memory_limit=512M" + } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini + + - name: Run PHPStan + uses: Touxten/.github/.github/actions/php-ci/phpstan@master + with: + php-version: ${{ matrix.php_version }} + presta-version: ${{ matrix.presta_version }} + module-name: ${{ github.event.repository.name }} + phpstan-level: '5' + phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon \ No newline at end of file diff --git a/README.md b/README.md index f59978f3..b9e3003f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ To use it, you will need to create a Google Analytics account and insert your Go ## Compatibility -PrestaShop: `1.7.7.0` or later +PrestaShop: `8.1.0` or later ### Notes diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index f2a48ebc..af890823 100644 --- a/ps_googleanalytics.php +++ b/ps_googleanalytics.php @@ -48,7 +48,7 @@ public function __construct() $this->name = 'ps_googleanalytics'; $this->tab = 'analytics_stats'; $this->version = '5.0.3'; - $this->ps_versions_compliancy = ['min' => '1.7.7', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '8.1.0', 'max' => _PS_VERSION_]; $this->author = 'PrestaShop'; $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; $this->bootstrap = true; diff --git a/tests/phpstan/index.php b/tests/php/index.php similarity index 69% rename from tests/phpstan/index.php rename to tests/php/index.php index c71b8a1e..6028c7f3 100644 --- a/tests/phpstan/index.php +++ b/tests/php/index.php @@ -1,19 +1,25 @@ - * @copyright Since 2007 PrestaShop SA and Contributors + * @copyright 2007-2020 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/tests/php/phpstan/index.php b/tests/php/phpstan/index.php new file mode 100644 index 00000000..6028c7f3 --- /dev/null +++ b/tests/php/phpstan/index.php @@ -0,0 +1,34 @@ + + * @copyright 2007-2020 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/phpstan/phpstan-1.7.7.neon b/tests/php/phpstan/phpstan-1.7.7.neon similarity index 100% rename from tests/phpstan/phpstan-1.7.7.neon rename to tests/php/phpstan/phpstan-1.7.7.neon diff --git a/tests/phpstan/phpstan-1.7.8.neon b/tests/php/phpstan/phpstan-1.7.8.neon similarity index 100% rename from tests/phpstan/phpstan-1.7.8.neon rename to tests/php/phpstan/phpstan-1.7.8.neon diff --git a/tests/phpstan/phpstan-8.0.neon b/tests/php/phpstan/phpstan-8.0.neon similarity index 100% rename from tests/phpstan/phpstan-8.0.neon rename to tests/php/phpstan/phpstan-8.0.neon diff --git a/tests/php/phpstan/phpstan-8.1.7.neon b/tests/php/phpstan/phpstan-8.1.7.neon new file mode 100644 index 00000000..37408b01 --- /dev/null +++ b/tests/php/phpstan/phpstan-8.1.7.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-8.2.x.neon b/tests/php/phpstan/phpstan-8.2.x.neon new file mode 100644 index 00000000..37408b01 --- /dev/null +++ b/tests/php/phpstan/phpstan-8.2.x.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.0.x.neon b/tests/php/phpstan/phpstan-9.0.x.neon new file mode 100644 index 00000000..37408b01 --- /dev/null +++ b/tests/php/phpstan/phpstan-9.0.x.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.1.x.neon b/tests/php/phpstan/phpstan-9.1.x.neon new file mode 100644 index 00000000..37408b01 --- /dev/null +++ b/tests/php/phpstan/phpstan-9.1.x.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-develop.neon b/tests/php/phpstan/phpstan-develop.neon new file mode 100644 index 00000000..37408b01 --- /dev/null +++ b/tests/php/phpstan/phpstan-develop.neon @@ -0,0 +1,8 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file diff --git a/tests/phpstan/phpstan-latest.neon b/tests/php/phpstan/phpstan-latest.neon similarity index 100% rename from tests/phpstan/phpstan-latest.neon rename to tests/php/phpstan/phpstan-latest.neon diff --git a/tests/php/phpstan/phpstan.neon b/tests/php/phpstan/phpstan.neon new file mode 100644 index 00000000..be11823c --- /dev/null +++ b/tests/php/phpstan/phpstan.neon @@ -0,0 +1,2 @@ + # Base PHPStan configuration for the moduleExpand commentComment on line R2ResolvedCode has comments. Press enter to view. + # This file is included by version-specific configs \ No newline at end of file diff --git a/tests/php/phpstan/prepend-constants.php b/tests/php/phpstan/prepend-constants.php new file mode 100644 index 00000000..733689a6 --- /dev/null +++ b/tests/php/phpstan/prepend-constants.php @@ -0,0 +1,11 @@ + Date: Sun, 22 Feb 2026 10:05:30 +0100 Subject: [PATCH 02/17] test --- ps_googleanalytics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index af890823..27326d19 100644 --- a/ps_googleanalytics.php +++ b/ps_googleanalytics.php @@ -48,7 +48,7 @@ public function __construct() $this->name = 'ps_googleanalytics'; $this->tab = 'analytics_stats'; $this->version = '5.0.3'; - $this->ps_versions_compliancy = ['min' => '8.1.0', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '8.1.0 ', 'max' => _PS_VERSION_]; $this->author = 'PrestaShop'; $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; $this->bootstrap = true; From 187727c2ca1a1da3c12b6b89c1dca9ceccf5c59e Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 10:14:27 +0100 Subject: [PATCH 03/17] Fix test --- tests/php/phpstan/phpstan-8.1.7.neon | 4 +++- tests/php/phpstan/phpstan-8.2.x.neon | 4 +++- tests/php/phpstan/phpstan-9.0.x.neon | 4 +++- tests/php/phpstan/phpstan-9.1.x.neon | 4 +++- tests/php/phpstan/phpstan-develop.neon | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/php/phpstan/phpstan-8.1.7.neon b/tests/php/phpstan/phpstan-8.1.7.neon index 37408b01..c2b3fac5 100644 --- a/tests/php/phpstan/phpstan-8.1.7.neon +++ b/tests/php/phpstan/phpstan-8.1.7.neon @@ -5,4 +5,6 @@ parameters: ignoreErrors: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' + - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-8.2.x.neon b/tests/php/phpstan/phpstan-8.2.x.neon index 37408b01..c2b3fac5 100644 --- a/tests/php/phpstan/phpstan-8.2.x.neon +++ b/tests/php/phpstan/phpstan-8.2.x.neon @@ -5,4 +5,6 @@ parameters: ignoreErrors: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' + - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.0.x.neon b/tests/php/phpstan/phpstan-9.0.x.neon index 37408b01..c2b3fac5 100644 --- a/tests/php/phpstan/phpstan-9.0.x.neon +++ b/tests/php/phpstan/phpstan-9.0.x.neon @@ -5,4 +5,6 @@ parameters: ignoreErrors: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' + - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.1.x.neon b/tests/php/phpstan/phpstan-9.1.x.neon index 37408b01..c2b3fac5 100644 --- a/tests/php/phpstan/phpstan-9.1.x.neon +++ b/tests/php/phpstan/phpstan-9.1.x.neon @@ -5,4 +5,6 @@ parameters: ignoreErrors: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' + - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-develop.neon b/tests/php/phpstan/phpstan-develop.neon index 37408b01..c2b3fac5 100644 --- a/tests/php/phpstan/phpstan-develop.neon +++ b/tests/php/phpstan/phpstan-develop.neon @@ -5,4 +5,6 @@ parameters: ignoreErrors: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' \ No newline at end of file + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' + - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file From 4b0682a15e01924245422207eaccfaefc6c86212 Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 10:21:13 +0100 Subject: [PATCH 04/17] fix --- tests/php/phpstan/phpstan-8.1.7.neon | 10 +++++----- tests/php/phpstan/phpstan-8.2.x.neon | 10 +++++----- tests/php/phpstan/phpstan-9.0.x.neon | 10 +++++----- tests/php/phpstan/phpstan-9.1.x.neon | 10 +++++----- tests/php/phpstan/phpstan-develop.neon | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/php/phpstan/phpstan-8.1.7.neon b/tests/php/phpstan/phpstan-8.1.7.neon index c2b3fac5..c02374b2 100644 --- a/tests/php/phpstan/phpstan-8.1.7.neon +++ b/tests/php/phpstan/phpstan-8.1.7.neon @@ -1,10 +1,10 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-8.2.x.neon b/tests/php/phpstan/phpstan-8.2.x.neon index c2b3fac5..c02374b2 100644 --- a/tests/php/phpstan/phpstan-8.2.x.neon +++ b/tests/php/phpstan/phpstan-8.2.x.neon @@ -1,10 +1,10 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.0.x.neon b/tests/php/phpstan/phpstan-9.0.x.neon index c2b3fac5..c02374b2 100644 --- a/tests/php/phpstan/phpstan-9.0.x.neon +++ b/tests/php/phpstan/phpstan-9.0.x.neon @@ -1,10 +1,10 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.1.x.neon b/tests/php/phpstan/phpstan-9.1.x.neon index c2b3fac5..c02374b2 100644 --- a/tests/php/phpstan/phpstan-9.1.x.neon +++ b/tests/php/phpstan/phpstan-9.1.x.neon @@ -1,10 +1,10 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-develop.neon b/tests/php/phpstan/phpstan-develop.neon index c2b3fac5..c02374b2 100644 --- a/tests/php/phpstan/phpstan-develop.neon +++ b/tests/php/phpstan/phpstan-develop.neon @@ -1,10 +1,10 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + ignoreErrors: + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file From 87ab18f03afd3ed6a0512a51aaf954d006b1ad7d Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 10:26:17 +0100 Subject: [PATCH 05/17] Fix for 9.x --- tests/php/phpstan/phpstan-9.0.x.neon | 3 +-- tests/php/phpstan/phpstan-9.1.x.neon | 3 +-- tests/php/phpstan/phpstan-develop.neon | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/php/phpstan/phpstan-9.0.x.neon b/tests/php/phpstan/phpstan-9.0.x.neon index c02374b2..00dcfae5 100644 --- a/tests/php/phpstan/phpstan-9.0.x.neon +++ b/tests/php/phpstan/phpstan-9.0.x.neon @@ -6,5 +6,4 @@ parameters: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.1.x.neon b/tests/php/phpstan/phpstan-9.1.x.neon index c02374b2..00dcfae5 100644 --- a/tests/php/phpstan/phpstan-9.1.x.neon +++ b/tests/php/phpstan/phpstan-9.1.x.neon @@ -6,5 +6,4 @@ parameters: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-develop.neon b/tests/php/phpstan/phpstan-develop.neon index c02374b2..00dcfae5 100644 --- a/tests/php/phpstan/phpstan-develop.neon +++ b/tests/php/phpstan/phpstan-develop.neon @@ -6,5 +6,4 @@ parameters: - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file From c069b841ab0d3aefe6071be2c409473b39609c77 Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 10:35:27 +0100 Subject: [PATCH 06/17] Restore PretaShop --- .github/workflows/php.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ced8bcbb..45c9ed42 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -56,7 +56,7 @@ jobs: } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini - name: Run PHPStan - uses: Touxten/.github/.github/actions/php-ci/phpstan@master + uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master with: php-version: ${{ matrix.php_version }} presta-version: ${{ matrix.presta_version }} @@ -92,7 +92,7 @@ jobs: } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini - name: Run PHPStan - uses: Touxten/.github/.github/actions/php-ci/phpstan@master + uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master with: php-version: ${{ matrix.php_version }} presta-version: ${{ matrix.presta_version }} @@ -126,7 +126,7 @@ jobs: } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini - name: Run PHPStan - uses: Touxten/.github/.github/actions/php-ci/phpstan@master + uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master with: php-version: ${{ matrix.php_version }} presta-version: ${{ matrix.presta_version }} From 34d9260cc4e35ba09fcf6b76e194c1af406936b5 Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 10:36:16 +0100 Subject: [PATCH 07/17] Fix space --- ps_googleanalytics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index 27326d19..af890823 100644 --- a/ps_googleanalytics.php +++ b/ps_googleanalytics.php @@ -48,7 +48,7 @@ public function __construct() $this->name = 'ps_googleanalytics'; $this->tab = 'analytics_stats'; $this->version = '5.0.3'; - $this->ps_versions_compliancy = ['min' => '8.1.0 ', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '8.1.0', 'max' => _PS_VERSION_]; $this->author = 'PrestaShop'; $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; $this->bootstrap = true; From af1e2f2c8ad1cd08175525ec3b4f4eda7d4bac03 Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Mon, 2 Mar 2026 17:54:03 +0100 Subject: [PATCH 08/17] github: new workflow to add issue to project --- .github/workflows/add-issue-to-project.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/add-issue-to-project.yml diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml new file mode 100644 index 00000000..cfa4ba3f --- /dev/null +++ b/.github/workflows/add-issue-to-project.yml @@ -0,0 +1,13 @@ +name: Add Issue to Project + +on: + issues: + types: [ opened ] + +jobs: + add-to-project: + uses: PrestaShop/.github/.github/workflows/reusable-add-to-project.yml@master + with: + project-number: 47 + secrets: + TOKEN: ${{ secrets.JARVIS_TOKEN }} From 4e64b4ffb47f9dffd239665a3217f72614da04dd Mon Sep 17 00:00:00 2001 From: mattgoud Date: Tue, 2 Jun 2026 17:04:09 +0200 Subject: [PATCH 09/17] CI: remove PHPStan job targeting PrestaShop 9.0.x The 9.0.x branch no longer exists. PHPStan coverage for PS 9.x is already provided by the phpstan job targeting 9.1.x and develop. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/php.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 45c9ed42..92dcb604 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -66,40 +66,6 @@ jobs: phpstan-version: '^0.12' composer-version: '2.2.18' - # Run PHPStan against the module (PHP 8.1 – 8.4) - phpstan-80-84: - name: PHPStan (PHP 8.1 - 8.4 ) - runs-on: ubuntu-latest - strategy: - matrix: - presta_version: ['9.0.x'] - php_version: ['8.1', '8.4'] - fail-fast: false - env: - PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - path: ${{ github.event.repository.name }} - - - name: Prepare PHP env for PrestaShop 9.0.x (define constants before any bootstrap) - run: | - mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini - { - echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php" - echo "memory_limit=512M" - } > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini - - - name: Run PHPStan - uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master - with: - php-version: ${{ matrix.php_version }} - presta-version: ${{ matrix.presta_version }} - module-name: ${{ github.event.repository.name }} - phpstan-level: '5' - phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon - # Run PHPStan against the module (PHP 8.1 – 8.5) phpstan: name: PHPStan (PHP 8.1 - 8.5) From e686cc5c68cb0c276b14e2966c3824d90f4f14cd Mon Sep 17 00:00:00 2001 From: mattgoud Date: Mon, 8 Jun 2026 17:49:18 +0200 Subject: [PATCH 10/17] Align module on PrestaShop 8.2+ minimum (Epic #41648) Drop the 8.1.7 target to match the project-wide module cleanup Epic which standardizes native modules on PS 8.2+: - php.yml: phpstan-74 matrix now runs against 8.2.x only (PHP 7.4/8.1) - ps_versions_compliancy min bumped to 8.2.0 - remove the now-unreferenced phpstan-8.1.7.neon config - remove the orphaned phpstan-9.0.x.neon config (no longer in the matrix) Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/php.yml | 2 +- ps_googleanalytics.php | 2 +- tests/php/phpstan/phpstan-8.1.7.neon | 10 ---------- tests/php/phpstan/phpstan-9.0.x.neon | 9 --------- 4 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 tests/php/phpstan/phpstan-8.1.7.neon delete mode 100644 tests/php/phpstan/phpstan-9.0.x.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 92dcb604..4ed444fd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - presta_version: ['8.1.7', '8.2.x'] + presta_version: ['8.2.x'] php_version: ['7.4', '8.1'] fail-fast: false env: diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index af890823..87412980 100644 --- a/ps_googleanalytics.php +++ b/ps_googleanalytics.php @@ -48,7 +48,7 @@ public function __construct() $this->name = 'ps_googleanalytics'; $this->tab = 'analytics_stats'; $this->version = '5.0.3'; - $this->ps_versions_compliancy = ['min' => '8.1.0', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '8.2.0', 'max' => _PS_VERSION_]; $this->author = 'PrestaShop'; $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; $this->bootstrap = true; diff --git a/tests/php/phpstan/phpstan-8.1.7.neon b/tests/php/phpstan/phpstan-8.1.7.neon deleted file mode 100644 index c02374b2..00000000 --- a/tests/php/phpstan/phpstan-8.1.7.neon +++ /dev/null @@ -1,10 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.0.x.neon b/tests/php/phpstan/phpstan-9.0.x.neon deleted file mode 100644 index 00dcfae5..00000000 --- a/tests/php/phpstan/phpstan-9.0.x.neon +++ /dev/null @@ -1,9 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file From a35abd8b094925d3f48805f5cb4f1ecf9dbaeeae Mon Sep 17 00:00:00 2001 From: mattgoud Date: Mon, 8 Jun 2026 17:58:50 +0200 Subject: [PATCH 11/17] Remove orphaned legacy PHPStan neon configs (Epic #41648) Drop dead PHPStan configs no longer referenced by the CI matrix (targeting PrestaShop versions < 8.2): - phpstan-1.7.7.neon - phpstan-1.7.8.neon - phpstan-8.0.neon - phpstan-latest.neon Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/php/phpstan/phpstan-1.7.7.neon | 9 --------- tests/php/phpstan/phpstan-1.7.8.neon | 8 -------- tests/php/phpstan/phpstan-8.0.neon | 8 -------- tests/php/phpstan/phpstan-latest.neon | 8 -------- 4 files changed, 33 deletions(-) delete mode 100644 tests/php/phpstan/phpstan-1.7.7.neon delete mode 100644 tests/php/phpstan/phpstan-1.7.8.neon delete mode 100644 tests/php/phpstan/phpstan-8.0.neon delete mode 100644 tests/php/phpstan/phpstan-latest.neon diff --git a/tests/php/phpstan/phpstan-1.7.7.neon b/tests/php/phpstan/phpstan-1.7.7.neon deleted file mode 100644 index caca5681..00000000 --- a/tests/php/phpstan/phpstan-1.7.7.neon +++ /dev/null @@ -1,9 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string given.#' diff --git a/tests/php/phpstan/phpstan-1.7.8.neon b/tests/php/phpstan/phpstan-1.7.8.neon deleted file mode 100644 index 364a960f..00000000 --- a/tests/php/phpstan/phpstan-1.7.8.neon +++ /dev/null @@ -1,8 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' diff --git a/tests/php/phpstan/phpstan-8.0.neon b/tests/php/phpstan/phpstan-8.0.neon deleted file mode 100644 index 364a960f..00000000 --- a/tests/php/phpstan/phpstan-8.0.neon +++ /dev/null @@ -1,8 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' diff --git a/tests/php/phpstan/phpstan-latest.neon b/tests/php/phpstan/phpstan-latest.neon deleted file mode 100644 index 364a960f..00000000 --- a/tests/php/phpstan/phpstan-latest.neon +++ /dev/null @@ -1,8 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon - -parameters: - ignoreErrors: - - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' From 3b86d3c9b181efbafa14b36cfe7164d62bd66fff Mon Sep 17 00:00:00 2001 From: mattgoud Date: Mon, 8 Jun 2026 18:11:49 +0200 Subject: [PATCH 12/17] Fix renderCartPage() PHPStan error; document remaining suppressions (Epic #41648) renderCartPage(): the method definition used a different case (renderCartpage) than its call site at run() (renderCartPage). PHP method names are case-insensitive so it worked at runtime, but the PHPStan 0.12 job flagged the definition as unused. Align the casing and drop its ignoreErrors entry. The remaining ignoreErrors are genuine framework/structural limitations, now documented inline in the neon configs: - Cookie magic __get/__set properties (ga_admin_order / ga_admin_refund) - parent::uninstall() called through a closure rebound via Closure::bindTo() - HookActionValidateOrder::$module: HookInterface mandates the (Ps_Googleanalytics $module, Context) constructor signature, so $module must be stored even though this hook never reads it back Co-Authored-By: Claude Opus 4.8 (1M context) --- classes/Hook/HookDisplayBeforeBodyClosingTag.php | 2 +- tests/php/phpstan/phpstan-8.2.x.neon | 7 ++++++- tests/php/phpstan/phpstan-9.1.x.neon | 8 +++++++- tests/php/phpstan/phpstan-develop.neon | 8 +++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/classes/Hook/HookDisplayBeforeBodyClosingTag.php b/classes/Hook/HookDisplayBeforeBodyClosingTag.php index 33457ff5..24e3a8c3 100644 --- a/classes/Hook/HookDisplayBeforeBodyClosingTag.php +++ b/classes/Hook/HookDisplayBeforeBodyClosingTag.php @@ -140,7 +140,7 @@ private function renderSearch() /** * This method renders tracking code for product listings, like category pages. */ - private function renderCartpage() + private function renderCartPage() { // Check if we are on cart page if ($this->context->controller->php_self != 'cart') { diff --git a/tests/php/phpstan/phpstan-8.2.x.neon b/tests/php/phpstan/phpstan-8.2.x.neon index c02374b2..914a4e6c 100644 --- a/tests/php/phpstan/phpstan-8.2.x.neon +++ b/tests/php/phpstan/phpstan-8.2.x.neon @@ -3,8 +3,13 @@ includes: parameters: ignoreErrors: + # Framework / structural limitations that cannot be fixed in module code: + # - uninstallModule() calls parent::uninstall() through a closure rebound to the + # target module via Closure::bindTo(), a pattern PHPStan cannot statically resolve. + # - Cookie uses magic __get/__set, so its dynamic properties are undefined to PHPStan. + # - HookInterface mandates the constructor signature (Ps_Googleanalytics $module, Context), + # so $module must be stored even in hooks that never read it back. - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' - - '#Method PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBeforeBodyClosingTag::renderCartpage\(\) is unused\.#' \ No newline at end of file diff --git a/tests/php/phpstan/phpstan-9.1.x.neon b/tests/php/phpstan/phpstan-9.1.x.neon index 00dcfae5..914a4e6c 100644 --- a/tests/php/phpstan/phpstan-9.1.x.neon +++ b/tests/php/phpstan/phpstan-9.1.x.neon @@ -3,7 +3,13 @@ includes: parameters: ignoreErrors: + # Framework / structural limitations that cannot be fixed in module code: + # - uninstallModule() calls parent::uninstall() through a closure rebound to the + # target module via Closure::bindTo(), a pattern PHPStan cannot statically resolve. + # - Cookie uses magic __get/__set, so its dynamic properties are undefined to PHPStan. + # - HookInterface mandates the constructor signature (Ps_Googleanalytics $module, Context), + # so $module must be stored even in hooks that never read it back. - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' diff --git a/tests/php/phpstan/phpstan-develop.neon b/tests/php/phpstan/phpstan-develop.neon index 00dcfae5..914a4e6c 100644 --- a/tests/php/phpstan/phpstan-develop.neon +++ b/tests/php/phpstan/phpstan-develop.neon @@ -3,7 +3,13 @@ includes: parameters: ignoreErrors: + # Framework / structural limitations that cannot be fixed in module code: + # - uninstallModule() calls parent::uninstall() through a closure rebound to the + # target module via Closure::bindTo(), a pattern PHPStan cannot statically resolve. + # - Cookie uses magic __get/__set, so its dynamic properties are undefined to PHPStan. + # - HookInterface mandates the constructor signature (Ps_Googleanalytics $module, Context), + # so $module must be stored even in hooks that never read it back. - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' - - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' \ No newline at end of file + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' From 0e6ea26e3ab3e4b73773277c61dcb2bca7b6ab94 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Tue, 9 Jun 2026 16:12:50 +0200 Subject: [PATCH 13/17] CI: address review - full PHP lint matrix, PHPStan floor 7.2, add PS 9.0.3 - php-linter: add missing intermediate syntax checks (7.3, 8.1, 8.2, 8.3, 8.4) - phpstan-74: lower floor to PHP 7.2 (real minimum for PS 8.2.x) - phpstan: add PrestaShop 9.0.3 (tag, the 9.0.x branch no longer exists) + neon config Part of PrestaShop/PrestaShop#41648 Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/php.yml | 23 +++++++++++++++++++---- tests/php/phpstan/phpstan-9.0.3.neon | 2 ++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 tests/php/phpstan/phpstan-9.0.3.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4ed444fd..d6f21b2d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -11,12 +11,27 @@ jobs: - name: PHP syntax checker 7.2 uses: prestashop/github-action-php-lint/7.2@master + - name: PHP syntax checker 7.3 + uses: prestashop/github-action-php-lint/7.3@master + - name: PHP syntax checker 7.4 uses: prestashop/github-action-php-lint/7.4@master - name: PHP syntax checker 8.0 uses: prestashop/github-action-php-lint/8.0@master + - name: PHP syntax checker 8.1 + uses: prestashop/github-action-php-lint/8.1@master + + - name: PHP syntax checker 8.2 + uses: prestashop/github-action-php-lint/8.2@master + + - name: PHP syntax checker 8.3 + uses: prestashop/github-action-php-lint/8.3@master + + - name: PHP syntax checker 8.4 + uses: prestashop/github-action-php-lint/8.4@master + - name: PHP syntax checker 8.5 uses: prestashop/github-action-php-lint/8.5@master @@ -30,14 +45,14 @@ jobs: with: php-version: '7.4' - # Run PHPStan against the module (PHP 7.4 – 8.1) + # Run PHPStan against the module (PHP 7.2 – 8.1) phpstan-74: - name: PHPStan (PHP 7.4 - 8.1) + name: PHPStan (PHP 7.2 - 8.1) runs-on: ubuntu-latest strategy: matrix: presta_version: ['8.2.x'] - php_version: ['7.4', '8.1'] + php_version: ['7.2', '8.1'] fail-fast: false env: PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini @@ -72,7 +87,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - presta_version: ['9.1.x', 'develop'] + presta_version: ['9.0.3', '9.1.x', 'develop'] php_version: ['8.1', '8.5'] fail-fast: false env: diff --git a/tests/php/phpstan/phpstan-9.0.3.neon b/tests/php/phpstan/phpstan-9.0.3.neon new file mode 100644 index 00000000..efa856c2 --- /dev/null +++ b/tests/php/phpstan/phpstan-9.0.3.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon From 2ca956c2ca7889af7349dce6314aac02cd0f4f03 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Tue, 9 Jun 2026 17:25:09 +0200 Subject: [PATCH 14/17] CI: fix failing PHPStan jobs - phpstan-9.0.3.neon was missing the ignoreErrors block (framework/structural limitations), so the PS 9.0.3 jobs reported them as errors; align it with the 9.1.x/develop configs - restore the phpstan-74 floor to PHP 7.4: the module's dev tooling (prestashop/php-dev-tools) pulls a dependency requiring PHP >= 7.4, so composer install fails on 7.2 (php-linter still covers 7.2 at the syntax level) Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/php.yml | 6 +++--- tests/php/phpstan/phpstan-9.0.3.neon | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d6f21b2d..a46ca917 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,14 +45,14 @@ jobs: with: php-version: '7.4' - # Run PHPStan against the module (PHP 7.2 – 8.1) + # Run PHPStan against the module (PHP 7.4 – 8.1) phpstan-74: - name: PHPStan (PHP 7.2 - 8.1) + name: PHPStan (PHP 7.4 - 8.1) runs-on: ubuntu-latest strategy: matrix: presta_version: ['8.2.x'] - php_version: ['7.2', '8.1'] + php_version: ['7.4', '8.1'] fail-fast: false env: PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini diff --git a/tests/php/phpstan/phpstan-9.0.3.neon b/tests/php/phpstan/phpstan-9.0.3.neon index efa856c2..914a4e6c 100644 --- a/tests/php/phpstan/phpstan-9.0.3.neon +++ b/tests/php/phpstan/phpstan-9.0.3.neon @@ -1,2 +1,15 @@ includes: - - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + - %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon + +parameters: + ignoreErrors: + # Framework / structural limitations that cannot be fixed in module code: + # - uninstallModule() calls parent::uninstall() through a closure rebound to the + # target module via Closure::bindTo(), a pattern PHPStan cannot statically resolve. + # - Cookie uses magic __get/__set, so its dynamic properties are undefined to PHPStan. + # - HookInterface mandates the constructor signature (Ps_Googleanalytics $module, Context), + # so $module must be stored even in hooks that never read it back. + - '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_order.#' + - '#Access to an undefined property Cookie\:\:\$ga_admin_refund.#' + - '#Property PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionValidateOrder::\$module is never read, only written\.#' From b8b6a2e508da140d67d258128b1f75afbfecc8a4 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Wed, 10 Jun 2026 15:13:46 +0200 Subject: [PATCH 15/17] CI: exclude unsupported PHP 8.5 for PrestaShop 9.0.x in PHPStan matrix PrestaShop 9.0.x supports PHP 8.1 up to 8.4 only, so the cross-product matrix was generating an invalid 9.0.3 x 8.5 combination. Switch to an explicit include list so each PrestaShop version tests its proper PHP floor and ceiling (9.0.3: 8.1/8.4, 9.1.x and develop: 8.1/8.5). Also make the "Prepare PHP env" step name reflect the actual matrix version. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/php.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a46ca917..db8e3ce0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -87,8 +87,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - presta_version: ['9.0.3', '9.1.x', 'develop'] - php_version: ['8.1', '8.5'] + include: + # PrestaShop 9.0.x supports PHP 8.1 up to 8.4 (8.5 is not supported) + - { presta_version: '9.0.3', php_version: '8.1' } + - { presta_version: '9.0.3', php_version: '8.4' } + # PrestaShop 9.1.x and develop support PHP 8.1 up to 8.5 + - { presta_version: '9.1.x', php_version: '8.1' } + - { presta_version: '9.1.x', php_version: '8.5' } + - { presta_version: 'develop', php_version: '8.1' } + - { presta_version: 'develop', php_version: '8.5' } fail-fast: false env: PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini @@ -98,7 +105,7 @@ jobs: with: path: ${{ github.event.repository.name }} - - name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap) + - name: Prepare PHP env for PrestaShop ${{ matrix.presta_version }} (define constants before any bootstrap) run: | mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini { From fd269ff78e254a50c9dbeee6e1c24d4ca011c1a9 Mon Sep 17 00:00:00 2001 From: mattgoud Date: Thu, 11 Jun 2026 10:56:37 +0200 Subject: [PATCH 16/17] Bump module version to 6.0.0 Co-Authored-By: Claude Opus 4.8 (1M context) --- config.xml | 2 +- ps_googleanalytics.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index 8976d9a9..cb9bf001 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ ps_googleanalytics - + diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index 87412980..fa3cfee7 100644 --- a/ps_googleanalytics.php +++ b/ps_googleanalytics.php @@ -47,7 +47,7 @@ public function __construct() { $this->name = 'ps_googleanalytics'; $this->tab = 'analytics_stats'; - $this->version = '5.0.3'; + $this->version = '6.0.0'; $this->ps_versions_compliancy = ['min' => '8.2.0', 'max' => _PS_VERSION_]; $this->author = 'PrestaShop'; $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; From 8d82f074478663b9ac4ca26c910a3a98c234e583 Mon Sep 17 00:00:00 2001 From: Matthias Goudjil <99822883+mattgoud@users.noreply.github.com> Date: Fri, 19 Jun 2026 16:53:24 +0200 Subject: [PATCH 17/17] Update README.md Co-authored-by: Jonathan Lelievre --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b9e3003f..1bf93443 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ To use it, you will need to create a Google Analytics account and insert your Go ## Compatibility -PrestaShop: `8.1.0` or later +PrestaShop: `8.2.0` or later ### Notes