From e6823cc0bfa2574e039095f85a9848de9bc1bea8 Mon Sep 17 00:00:00 2001 From: Thomas Roux Date: Sun, 22 Feb 2026 09:48:53 +0100 Subject: [PATCH 1/7] 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 f820d74..ced8bcb 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 f59978f..b9e3003 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 f2a48eb..af89082 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 c71b8a1..6028c7f 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 0000000..6028c7f --- /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 0000000..37408b0 --- /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 0000000..37408b0 --- /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 0000000..37408b0 --- /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 0000000..37408b0 --- /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 0000000..37408b0 --- /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 0000000..be11823 --- /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 0000000..733689a --- /dev/null +++ b/tests/php/phpstan/prepend-constants.php @@ -0,0 +1,11 @@ + Date: Sun, 22 Feb 2026 10:05:30 +0100 Subject: [PATCH 2/7] test --- ps_googleanalytics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index af89082..27326d1 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 3/7] 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 37408b0..c2b3fac 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 37408b0..c2b3fac 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 37408b0..c2b3fac 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 37408b0..c2b3fac 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 37408b0..c2b3fac 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 4/7] 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 c2b3fac..c02374b 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 c2b3fac..c02374b 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 c2b3fac..c02374b 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 c2b3fac..c02374b 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 c2b3fac..c02374b 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 5/7] 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 c02374b..00dcfae 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 c02374b..00dcfae 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 c02374b..00dcfae 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 6/7] 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 ced8bcb..45c9ed4 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 7/7] Fix space --- ps_googleanalytics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_googleanalytics.php b/ps_googleanalytics.php index 27326d1..af89082 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;