Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAYSHIP-3149] PrestaShop 9 compatibility #1304

Open
wants to merge 38 commits into
base: prestashop/9.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1a1d7f0
Updated dependencies to be compatible with php 8.1
L3RAZ Nov 7, 2024
5259d79
AdminAjaxController response fixes
L3RAZ Dec 13, 2024
5ea8fca
Command handler fix
L3RAZ Nov 8, 2024
1bfb530
Semi-working order workflow
L3RAZ Dec 30, 2024
01ba9b3
Fixed some command handlers
L3RAZ Dec 30, 2024
14a7383
Fixed translation in admin ajax controller
L3RAZ Dec 31, 2024
4e26106
Removed commented code
L3RAZ Jan 2, 2025
67e5f16
Added latest features from PS8
L3RAZ Jan 2, 2025
a6089d8
Fixed deprecated functions
L3RAZ Jan 6, 2025
c644657
Removed deprecated function usage
L3RAZ Jan 8, 2025
7f0e5b0
Removed 1.7 PS version checks
L3RAZ Jan 8, 2025
a133991
Removed useless views
L3RAZ Jan 9, 2025
934b5f4
Fixed translation keys
L3RAZ Jan 9, 2025
edaf568
Fixed translations
L3RAZ Jan 9, 2025
7654b17
Code review fixes
L3RAZ Jan 9, 2025
b8eb84d
Code review fix
L3RAZ Jan 9, 2025
a26475e
Cache fix
L3RAZ Jan 9, 2025
8ec4e70
Fixed missing event subscriber
L3RAZ Jan 10, 2025
0ea929f
Fixed circular dependency for Capture handler
L3RAZ Jan 10, 2025
42be99e
Restored logic from PS8 branch
L3RAZ Jan 10, 2025
8c61212
Uncommented PSL signature check
L3RAZ Jan 15, 2025
582f81f
Added autowiring
L3RAZ Jan 16, 2025
dbee521
Fixed property visibility
L3RAZ Jan 16, 2025
c1e98d7
Added property promotion
L3RAZ Jan 17, 2025
95469e2
Fixed CS fixer
L3RAZ Jan 22, 2025
2beb223
Update gitignore
L3RAZ Jan 22, 2025
ec84748
Review fixes
L3RAZ Jan 23, 2025
4ee2436
use Tools::getContextLocale
L3RAZ Jan 28, 2025
6f56c31
Added missing license headers
L3RAZ Jan 28, 2025
b23bf46
Fixed test
L3RAZ Jan 28, 2025
d464353
PS9 CI (#1311)
L3RAZ Jan 28, 2025
c144529
Removed unused dependency
L3RAZ Jan 29, 2025
dd12f56
Changed docker ps version
L3RAZ Jan 29, 2025
6d62b49
CS fixer fix
L3RAZ Jan 29, 2025
ce5508d
PHPStan workflow fix
L3RAZ Jan 29, 2025
40e8ea7
Unit tests fix
L3RAZ Jan 30, 2025
b9d1068
phpstan github error format fix
L3RAZ Jan 30, 2025
3a6c1b6
Update phpstan level
L3RAZ Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP 7.4
- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.1"
tools: composer:v2

- name: Cache vendor folder
uses: actions/cache@v1
Expand All @@ -33,21 +34,21 @@ jobs:
- run: composer install

- name: Run Header Stamp in Dry Run mode
run: php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,node_modules,vendor,tests,_dev --dry-run
run: php vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,vendor,tests --dry-run

php-linter:
name: PHP Syntax check 7.2|7.3|7.4
name: PHP Syntax check 8.1|8.2|8.3
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'ready to review')
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
- 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.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

php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -56,15 +57,30 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
tools: composer:v2

- name: Cache composer folder
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-composer-cache

- run: composer install

- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
run: php vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no

phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ["8.0.0", "latest"]
presta-versions: ["9.0.x-apache"]
if: contains(github.event.pull_request.labels.*.name, 'ready to review')
steps:
- name: Checkout
Expand All @@ -88,8 +104,10 @@ jobs:
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}

- name: Run PHPStan
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan-PS-8.neon --error-format github
run: docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_checkout -e _PS_ROOT_DIR_=/var/www/html/ --workdir=/var/www/html/modules/ps_checkout ghcr.io/phpstan/phpstan:latest-php8.1 analyse --configuration=/var/www/html/modules/ps_checkout/tests/phpstan/phpstan-PS-9.neon --error-format=github

- name: test
run: docker exec temp-ps ls -la /var/www/html/modules/ps_checkout
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
Expand All @@ -98,10 +116,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP 7.4
- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.1"

- name: Cache vendor folder
uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@ $RECYCLE.BIN/
# End of https://www.gitignore.io/api/vim,vuejs,emacs,linux,macos,windows,phpstorm,composer,sublimetext,visualstudiocode

# CS Fixer
.php_cs.cache
.php-cs-fixer.cache
1 change: 1 addition & 0 deletions .php-cs-fixer.cache

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

require_once './vendor/prestashop/php-dev-tools/src/CsFixer/Config.php';

$config = new PrestaShop\CodingStandards\CsFixer\Config();

/** @var \Symfony\Component\Finder\Finder $finder */
$finder = $config->setUsingCache(true)->getFinder();
$finder->in(__DIR__)->exclude('vendor');

return $config;
12 changes: 0 additions & 12 deletions .php_cs.dist

This file was deleted.

23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,36 @@
],
"config": {
"platform": {
"php": "7.2.34"
"php": "8.1"
},
"sort-packages": true,
"preferred-install": "dist",
"optimize-autoloader": true,
"prepend-autoloader": false
},
"require": {
"php": ">=7.2",
"php": ">=8.1",
"giggsey/libphonenumber-for-php": "^8.12",
"gmponos/guzzle_logger": "^2.2",
"guzzlehttp/guzzle": "^7.4",
"prestashop/decimal": "^1.3",
"prestashop/module-lib-guzzle-adapter": "^1.0",
"prestashop/module-lib-mbo-installer": "^2.0",
"prestashop/module-lib-service-container": "^1.0",
"prestashop/module-lib-service-container": "^2.0",
"prestashop/prestashop-accounts-installer": "^1.0",
"ramsey/uuid": "^3.8",
"segmentio/analytics-php": "^1.5",
"sentry/sentry": "^1.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~5.7",
"prestashop/php-dev-tools": "~3.0",
"friendsofphp/php-cs-fixer": "^3.68",
"monolog/monolog": "^1.27.1",
"prestashop/autoindex": "^1.0"
"nikic/php-parser": "^4.19.1",
"phpunit/php-code-coverage": "^9.2.31",
"phpunit/phpunit": "~9.6.7",
"prestashop/autoindex": "^2.1",
"prestashop/header-stamp": "^2.3",
"prestashop/php-dev-tools": "~5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -63,13 +66,13 @@
"@php ./vendor/bin/header-stamp --license=vendor/prestashop/header-stamp/assets/afl.txt --exclude=.github,node_modules,vendor,tests,_dev"
],
"php-cs-fixer:check": [
"@php ./vendor/bin/php-cs-fixer fix --dry-run --diff"
"@php ./vendor/bin/php-cs-fixer fix --dry-run --diff"
],
"php-cs-fixer:fix": [
"@php ./vendor/bin/php-cs-fixer fix"
"@php ./vendor/bin/php-cs-fixer fix"
],
"auto-index": [
"@php ./vendor/bin/autoindex --exclude=_dev,vendor,tests"
"@php ./vendor/bin/autoindex --exclude=_dev,vendor,tests"
]
},
"author": "PrestaShop"
Expand Down
Loading
Loading