Disallows assignments in some control structures
[MAILPOET-2090]
This commit is contained in:
@@ -142,7 +142,8 @@ class SendingQueue extends Model {
|
|||||||
$subscribers = $this->getSubscribers();
|
$subscribers = $this->getSubscribers();
|
||||||
return in_array($subscriber_id, $subscribers['processed']);
|
return in_array($subscriber_id, $subscribers['processed']);
|
||||||
} else {
|
} else {
|
||||||
if ($task = $this->task()->findOne()) {
|
$task = $this->task()->findOne();
|
||||||
|
if ($task) {
|
||||||
$task_subscribers = new TaskSubscribers($task);
|
$task_subscribers = new TaskSubscribers($task);
|
||||||
return $task_subscribers->isSubscriberProcessed($subscriber_id);
|
return $task_subscribers->isSubscriberProcessed($subscriber_id);
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,8 @@ class API {
|
|||||||
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
|
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case 200:
|
case 200:
|
||||||
if ($body = $this->wp->wpRemoteRetrieveBody($result)) {
|
$body = $this->wp->wpRemoteRetrieveBody($result);
|
||||||
|
if ($body) {
|
||||||
$body = json_decode($body, true);
|
$body = json_decode($body, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -23,7 +23,8 @@ class API {
|
|||||||
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
|
$code = $this->wp->wpRemoteRetrieveResponseCode($result);
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case 200:
|
case 200:
|
||||||
if ($body = $this->wp->wpRemoteRetrieveBody($result)) {
|
$body = $this->wp->wpRemoteRetrieveBody($result);
|
||||||
|
if ($body) {
|
||||||
$body = json_decode($body);
|
$body = json_decode($body);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
<!-- This sniff enforces trailing commas in multi-line arrays -->
|
<!-- This sniff enforces trailing commas in multi-line arrays -->
|
||||||
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
|
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
|
||||||
|
<!-- Disallows assignments in if, elseif and do-while loop conditions -->
|
||||||
|
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
|
||||||
<!-- Control structures must have at least one statement in the body -->
|
<!-- Control structures must have at least one statement in the body -->
|
||||||
<!--<rule ref="Generic.CodeAnalysis.EmptyStatement"/>-->
|
<!--<rule ref="Generic.CodeAnalysis.EmptyStatement"/>-->
|
||||||
<!-- For loops with only second expression should be while loops -->
|
<!-- For loops with only second expression should be while loops -->
|
||||||
|
Reference in New Issue
Block a user