Skip to content

Commit f5b3c74

Browse files
authored
Merge pull request PrestaShop#108 from Hlavtox/remove-ajaxdie
Remove usage of ajaxDie
2 parents f83eaa3 + 137a2e0 commit f5b3c74

File tree

8 files changed

+17
-5
lines changed

8 files changed

+17
-5
lines changed

controllers/front/subscription.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ public function postProcess()
5454

5555
if ($this->ajax) {
5656
header('Content-Type: application/json');
57-
$this->ajaxDie(json_encode($this->variables));
57+
if (version_compare(_PS_VERSION_, '1.7.5', '>=')) {
58+
$this->ajaxRender(json_encode($this->variables));
59+
exit;
60+
} else {
61+
$this->ajaxDie(json_encode($this->variables));
62+
}
5863
}
5964
}
6065
}

tests/phpstan/phpstan-1.7.1.2.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ parameters:
1111
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1212
- '#Parameter \#4 \$templateVars of static method MailCore::Send\(\) expects string, array given.#'
1313
- '#Parameter \#4 \$templateVars of static method MailCore::Send\(\) expects string, array<string, string> given.#'
14+
- '#Call to an undefined method Ps_EmailsubscriptionSubscriptionModuleFrontController::ajaxRender\(\).#'

tests/phpstan/phpstan-1.7.2.5.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ parameters:
1010
- '#Parameter \#1 \$id of class Customer constructor expects null, int given.#'
1111
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1212
- '#Parameter \#4 \$templateVars of static method MailCore::Send\(\) expects string, array given.#'
13-
- '#Parameter \#4 \$templateVars of static method MailCore::Send\(\) expects string, array<string, string> given.#'
13+
- '#Parameter \#4 \$templateVars of static method MailCore::Send\(\) expects string, array<string, string> given.#'
14+
- '#Call to an undefined method Ps_EmailsubscriptionSubscriptionModuleFrontController::ajaxRender\(\).#'

tests/phpstan/phpstan-1.7.3.4.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ parameters:
1111
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1212
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array given.#'
1313
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
14+
- '#Call to an undefined method Ps_EmailsubscriptionSubscriptionModuleFrontController::ajaxRender\(\).#'

tests/phpstan/phpstan-1.7.4.4.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ parameters:
99
- '#Parameter \#1 \$id of class Customer constructor expects null, int given.#'
1010
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1111
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array given.#'
12-
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
12+
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
13+
- '#Call to an undefined method Ps_EmailsubscriptionSubscriptionModuleFrontController::ajaxRender\(\).#'

tests/phpstan/phpstan-1.7.5.1.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ parameters:
99
- '#Parameter \#1 \$id of class Customer constructor expects null, int given.#'
1010
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1111
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array given.#'
12-
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
12+
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
13+
- '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string|false given.#'

tests/phpstan/phpstan-1.7.6.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ parameters:
1010
- '#Parameter \#4 \$ssl of method LinkCore::getModuleLink\(\) expects null, true given.#'
1111
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array given.#'
1212
- '#Parameter \#4 \$templateVars of static method MailCore::send\(\) expects string, array<string, string> given.#'
13+
- '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string|false given.#'

tests/phpstan/phpstan-1.7.7.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ includes:
44
parameters:
55
ignoreErrors:
66
- '#Access to an undefined property Cookie::\$shop.#'
7-
- '#Access to an undefined property HelperList::\$shopLinkType.#'
7+
- '#Access to an undefined property HelperList::\$shopLinkType.#'
8+
- '#Parameter \#1 \$value of method ControllerCore::ajaxRender\(\) expects null, string|false given.#'

0 commit comments

Comments
 (0)