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

Release 3.0.1 #148

Merged
merged 12 commits into from
Dec 2, 2024
12 changes: 9 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 7.1 => 8.2
name: PHP Syntax check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

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

- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
Expand All @@ -30,6 +30,12 @@ jobs:
- 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

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -38,7 +44,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'

- name: Checkout
uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
.php_cs.cache
.php-cs-fixer.cache
10 changes: 9 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php

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

$config = new PhpCsFixer\Config();
$config
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules(array_merge($psConfig->getRules(), [
'blank_lines_before_namespace' => false,
'nullable_type_declaration_for_default_null_value' => true,
'blank_line_after_opening_tag' => false,
'linebreak_after_opening_tag' => false,
]))
->getFinder()
->in(__DIR__)
->exclude('vendor');
Expand Down
2 changes: 1 addition & 1 deletion MailAlert.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function deleteAlert($id_customer, $customer_email, $id_product, $
/*
* Get objects that will be viewed on "My alerts" page
*/
public static function getMailAlerts($id_customer, $id_lang, Shop $shop = null)
public static function getMailAlerts($id_customer, $id_lang, ?Shop $shop = null)
{
if (!Validate::isUnsignedId($id_customer) || !Validate::isUnsignedId($id_lang)) {
exit(Tools::displayError());
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"php": ">=7.1.3"
},
"require-dev": {
"prestashop/php-dev-tools": "^4.3"
"prestashop/php-dev-tools": "^5",
"friendsofphp/php-cs-fixer": "^v3"
},
"config": {
"preferred-install": "dist",
"prepend-autoloader": false
},
"type": "prestashop-module",
"author": "PrestaShop"
}
}
Loading