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

Bump min compatibility to PHP 7.1.3 and PS 1.7.7, module version to 3.0.0 #137

Merged
merged 5 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 5.6 => 8.1
name: PHP Syntax check 7.1 => 8.2
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v3.1.0

- name: PHP syntax checker 5.6
- name: PHP syntax checker 7.1
uses: prestashop/github-action-php-lint/5.6@master

- name: PHP syntax checker 7.2
Expand All @@ -27,6 +27,9 @@ jobs:
- 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

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -38,10 +41,10 @@ jobs:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v3.1.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand All @@ -50,29 +53,29 @@ jobs:
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: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no

# Run PHPStan against the module and a PrestaShop release
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['1.7.6', '1.7.7', '1.7.8', 'latest']
presta-versions: ['1.7.7', '1.7.8', '8.0', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v3.1.0

# Add vendor folder in cache to make next builds faster
- name: Cache vendor folder
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

# Add composer local folder in cache to make next builds faster
- name: Cache composer folder
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: php-composer-cache
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions MailAlert.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public static function getMailAlerts($id_customer, $id_lang, Shop $shop = null)
continue;
}

if (isset($products[$i]['id_product_attribute']) &&
Validate::isUnsignedInt($products[$i]['id_product_attribute'])) {
if (isset($products[$i]['id_product_attribute'])
&& Validate::isUnsignedInt($products[$i]['id_product_attribute'])) {
$attributes = self::getProductAttributeCombination($products[$i]['id_product_attribute'], $id_lang);
$products[$i]['attributes_small'] = '';

Expand Down Expand Up @@ -197,8 +197,8 @@ public static function sendCustomerAlert($id_product, $id_product_attribute)

$translator = Context::getContext()->getTranslatorFromLocale($locale);

if (file_exists(dirname(__FILE__) . '/mails/' . $iso . '/customer_qty.txt') &&
file_exists(dirname(__FILE__) . '/mails/' . $iso . '/customer_qty.html')) {
if (file_exists(dirname(__FILE__) . '/mails/' . $iso . '/customer_qty.txt')
&& file_exists(dirname(__FILE__) . '/mails/' . $iso . '/customer_qty.html')) {
try {
Mail::Send(
$id_lang,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Make your everyday life easier, handle mail alerts about stock and orders, addre

## Compatibility

PrestaShop: `1.7.6.0` or later
PrestaShop: `1.7.7.0` or later

## Multistore compatibility

Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
}
],
"require": {
"php": ">=5.6"
"php": ">=7.1.3"
},
"require-dev": {
"prestashop/php-dev-tools": "^3.16"
"prestashop/php-dev-tools": "^4.3"
},
"config": {
"platform": {
"php": "5.6.0"
},
"preferred-install": "dist",
"prepend-autoloader": false
},
Expand Down