Skip to content

Commit 343abf0

Browse files
authored
fix uninitialized property check before being accessed
In PHP 7.4 accessing uninitialized property throws exception eg. HealthCheckDefinition::$TimeoutDuration must not be accessed before initialization
1 parent 2270b8e commit 343abf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Health/HealthCheckDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ public function __construct(?array $data = null)
123123
} else {
124124
$this->Interval = ReadableDuration::fromDuration((string)$this->IntervalDuration);
125125
}
126-
if (null === $this->TimeoutDuration) {
126+
if (!isset($this->TimeoutDuration)) {
127127
$this->TimeoutDuration = Time::ParseDuration((string)$this->Timeout);
128128
} else {
129129
$this->Timeout = ReadableDuration::fromDuration((string)$this->TimeoutDuration);
130130
}
131-
if (null === $this->DeregisterCriticalServiceAfterDuration) {
131+
if (!isset($this->DeregisterCriticalServiceAfterDuration)) {
132132
$this->DeregisterCriticalServiceAfterDuration = Time::ParseDuration(
133133
(string)$this->DeregisterCriticalServiceAfter
134134
);

0 commit comments

Comments
 (0)