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