Skip to content

Commit c472b8c

Browse files
ENGCOM-5825: Refactor isSubscribed method to return the output of the expression #24534
- Merge Pull Request #24534 from will-in-wi/magento2:simplify-boolean-return - Merged commits: 1. 5830d5d 2. 0f140b0 3. f0b9a96
2 parents ed9fecc + f0b9a96 commit c472b8c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/code/Magento/Newsletter/Model/Subscriber.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,7 @@ public function isStatusChanged()
353353
*/
354354
public function isSubscribed()
355355
{
356-
if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) {
357-
return true;
358-
}
359-
360-
return false;
356+
return $this->getId() && (int)$this->getStatus() === self::STATUS_SUBSCRIBED;
361357
}
362358

363359
/**

0 commit comments

Comments
 (0)