-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/php 81 #178
base: master
Are you sure you want to change the base?
Feature/php 81 #178
Conversation
final const PAGE_NUMBER = 0; | ||
final const PAGE_SIZE = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final const PAGE_NUMBER = 0; | |
final const PAGE_SIZE = 10; | |
private const PAGE_NUMBER = 0; | |
private const PAGE_SIZE = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But please ensure that it's not used externally.
final CONST PAGE_SIZE_MIN = 0; | ||
final const PAGE_SIZE_MAX = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final CONST PAGE_SIZE_MIN = 0; | |
final const PAGE_SIZE_MAX = 1000; | |
private CONST PAGE_SIZE_MIN = 0; | |
private const PAGE_SIZE_MAX = 1000; |
@@ -148,7 +148,7 @@ public function actionIndex() | |||
* @throws \yii\base\InvalidConfigException | |||
* @throws ForbiddenHttpException | |||
*/ | |||
public function actionCreate() | |||
public function actionCreate(): array|\api\modules\v1\models\customer\CustomerEx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type is wrong.
@@ -238,7 +238,7 @@ public function actionCreate() | |||
* @return array|\api\modules\v1\models\customer\CustomerEx | |||
* @throws ForbiddenHttpException | |||
*/ | |||
public function actionView($id) | |||
public function actionView($id): array|\api\modules\v1\models\customer\CustomerEx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type is wrong.
@@ -325,7 +325,7 @@ public function actionView($id) | |||
* @throws \yii\base\InvalidConfigException | |||
* @throws ForbiddenHttpException | |||
*/ | |||
public function actionUpdate($id) | |||
public function actionUpdate($id): array|\api\modules\v1\models\customer\CustomerEx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type is wrong.
@@ -38,8 +38,8 @@ public function behaviors(): array | |||
|
|||
public function init(): void | |||
{ | |||
$this->on(self::EVENT_AFTER_UPDATE, [$this, 'createJobIfNeeded']); | |||
$this->on(self::EVENT_AFTER_INSERT, [$this, 'createJobIfNeeded']); | |||
$this->on(self::EVENT_AFTER_UPDATE, $this->createJobIfNeeded(...)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks wrong.
@@ -53,7 +53,7 @@ public function scenarios(): array | |||
|
|||
public function init(): void | |||
{ | |||
$this->on(self::EVENT_BEFORE_INSERT, [$this, 'orderHistoryPopulate']); | |||
$this->on(self::EVENT_BEFORE_INSERT, $this->orderHistoryPopulate(...)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks wrong. Let's search for (...)
everywhere.
@@ -448,6 +449,8 @@ public function actionClone($id) | |||
*/ | |||
public function actionDelete($id) | |||
{ | |||
$model = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for it.
@@ -448,6 +449,8 @@ public function actionClone($id) | |||
*/ | |||
public function actionDelete($id) | |||
{ | |||
$model = null; | |||
$transaction = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for it. It is initialized properly when used. Similar in
@@ -772,7 +775,7 @@ public function actionImport() | |||
|
|||
$model = new OrderImport(); | |||
|
|||
if (count($customers) === 1) { | |||
if ((is_countable($customers) ? count($customers) : 0) === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$customers
can't be non-array, no need for this check.
No description provided.