Skip to content

Commit

Permalink
PHPStan - Level 4
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Aug 27, 2024
1 parent a8681cc commit 66ae22e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 0 additions & 4 deletions phpstan-default-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
parameters:
ignoreErrors:
-
message: "#^Strict comparison using \\=\\=\\= between null and Serhiy\\\\Pushover\\\\Recipient will always evaluate to false\\.$#"
count: 1
path: src/Api/Glances/Glance.php
15 changes: 7 additions & 8 deletions src/Api/Glances/Glance.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Glance
/**
* Pushover user.
*/
private Recipient $recipient;
private ?Recipient $recipient = null;
private GlanceDataFields $glanceDataFields;

public function __construct(Application $application, GlanceDataFields $glanceDataFields)
Expand Down Expand Up @@ -82,10 +82,12 @@ public function setGlanceDataFields(GlanceDataFields $glanceDataFields): void

public function hasAtLeastOneField(): bool
{
if (null === $this->getGlanceDataFields()->getTitle()
&& null === $this->getGlanceDataFields()->getSubtext()
&& null === $this->getGlanceDataFields()->getCount()
&& null === $this->getGlanceDataFields()->getPercent()
$glanceDataFields = $this->getGlanceDataFields();

if (null === $glanceDataFields->getTitle()
&& null === $glanceDataFields->getSubtext()
&& null === $glanceDataFields->getCount()
&& null === $glanceDataFields->getPercent()
) {
return false;
}
Expand All @@ -102,9 +104,6 @@ public function hasRecipient(): bool
return true;
}

/**
* Push glance.
*/
public function push(): GlancesResponse
{
$client = new GlancesClient();
Expand Down

0 comments on commit 66ae22e

Please sign in to comment.