Skip to content

Commit

Permalink
Merge pull request #105 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 4.2.2
  • Loading branch information
Progi1984 committed Jun 10, 2021
2 parents bf361ef + 5835e8d commit 0058f82
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 202 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,25 @@ jobs:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Checkout
uses: actions/[email protected]

- name: Cache dependencies
uses: actions/cache@v2
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: Install dependencies
run: composer install

- name: Run PHP-CS-Fixer
uses: prestashopcorp/github-action-php-cs-fixer@master
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:
Expand Down
10 changes: 5 additions & 5 deletions ProductCommentCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function update($nullValues = false)
public function addProduct($id_product)
{
if (!Validate::isUnsignedId($id_product)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -117,7 +117,7 @@ public function addProduct($id_product)
public function addCategory($id_category)
{
if (!Validate::isUnsignedId($id_category)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -134,7 +134,7 @@ public function addCategory($id_category)
public function addGrade($id_product_comment, $grade)
{
if (!Validate::isUnsignedId($id_product_comment)) {
die(Tools::displayError());
exit(Tools::displayError());
}
if ($grade < 0) {
$grade = 0;
Expand All @@ -159,7 +159,7 @@ public static function getByProduct($id_product, $id_lang)
{
if (!Validate::isUnsignedId($id_product) ||
!Validate::isUnsignedId($id_lang)) {
die(Tools::displayError());
exit(Tools::displayError());
}
$alias = 'p';
$table = '';
Expand Down Expand Up @@ -205,7 +205,7 @@ public static function getByProduct($id_product, $id_lang)
public static function getCriterions($id_lang, $type = false, $active = false)
{
if (!Validate::isUnsignedId($id_lang)) {
die(Tools::displayError());
exit(Tools::displayError());
}

$sql = '
Expand Down
16 changes: 8 additions & 8 deletions ProductCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function add($id_lang, $name)
{
if (!Validate::isUnsignedId($id_lang) ||
!Validate::isMessage($name)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -53,7 +53,7 @@ public static function addToProduct($id_product_comment_criterion, $id_product)
{
if (!Validate::isUnsignedId($id_product_comment_criterion) ||
!Validate::isUnsignedId($id_product)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -72,7 +72,7 @@ public static function addGrade($id_product_comment, $id_product_comment_criteri
{
if (!Validate::isUnsignedId($id_product_comment) ||
!Validate::isUnsignedId($id_product_comment_criterion)) {
die(Tools::displayError());
exit(Tools::displayError());
}
if ($grade < 0) {
$grade = 0;
Expand All @@ -98,7 +98,7 @@ public static function update($id_product_comment_criterion, $id_lang, $name)
if (!Validate::isUnsignedId($id_product_comment_criterion) ||
!Validate::isUnsignedId($id_lang) ||
!Validate::isMessage($name)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -117,7 +117,7 @@ public static function getByProduct($id_product, $id_lang)
{
if (!Validate::isUnsignedId($id_product) ||
!Validate::isUnsignedId($id_lang)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->executeS('
Expand All @@ -136,7 +136,7 @@ public static function getByProduct($id_product, $id_lang)
public static function get($id_lang)
{
if (!Validate::isUnsignedId($id_lang)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->executeS('
Expand All @@ -154,7 +154,7 @@ public static function get($id_lang)
public static function deleteByProduct($id_product)
{
if (!Validate::isUnsignedId($id_product)) {
die(Tools::displayError());
exit(Tools::displayError());
}

return Db::getInstance()->execute('
Expand All @@ -170,7 +170,7 @@ public static function deleteByProduct($id_product)
public static function delete($id_product_comment_criterion)
{
if (!Validate::isUnsignedId($id_product_comment_criterion)) {
die(Tools::displayError());
exit(Tools::displayError());
}
$result = Db::getInstance()->execute('
DELETE FROM `' . _DB_PREFIX_ . 'product_comment_grade`
Expand Down
Loading

0 comments on commit 0058f82

Please sign in to comment.