Skip to content

Commit

Permalink
Simplify boolean expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ober committed Nov 4, 2023
1 parent 8ac9f2a commit 89c6496
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notification_service.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,20 @@ public function force_send_discord_notification($discord_webhook_url, $message)
*/
private function execute_discord_webhook($discord_webhook_url, $color, $message, $title = null, $preview = null, $footer = null)
{
if (isset($discord_webhook_url) == false || $discord_webhook_url === '')
if (!isset($discord_webhook_url) || $discord_webhook_url === '')
{
return false;
}
if (is_integer($color) == false || $color < 0)
if (!is_integer($color) || $color < 0)
{
// Use the default color if we did not receive a valid color value
$color = self::DEFAULT_COLOR;
}
if (is_string($message) == false || $message == '')
if (!is_string($message) || $message == '')
{
return false;
}
if (isset($footer) == true && (is_string($footer) == false || $footer == ''))
if (isset($footer) && (!is_string($footer) || $footer == ''))
{
return false;
}
Expand Down

0 comments on commit 89c6496

Please sign in to comment.