diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 81e1f337..db84a0e9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $type @@ -921,7 +921,7 @@ \IteratorAggregate - c + entries[$id] ?? null]]> diff --git a/src/Client/Schedule/Spec/ScheduleSpec.php b/src/Client/Schedule/Spec/ScheduleSpec.php index 834051c3..3ad38b34 100644 --- a/src/Client/Schedule/Spec/ScheduleSpec.php +++ b/src/Client/Schedule/Spec/ScheduleSpec.php @@ -312,12 +312,13 @@ public function withEndTime(DateTimeInterface|string|null $dateTime): self */ public function withJitter(mixed $interval): self { + /** @psalm-suppress RiskyTruthyFalsyComparison */ if (empty($interval)) { /** @see self::$jitter */ return $this->with('jitter', new \DateInterval('PT0S')); } - assert(DateInterval::assert($interval)); + \assert(DateInterval::assert($interval)); $interval = DateInterval::parse($interval, DateInterval::FORMAT_SECONDS); /** @see self::$jitter */ diff --git a/src/Internal/Marshaller/TypeFactory.php b/src/Internal/Marshaller/TypeFactory.php index 3f92c722..806582a9 100644 --- a/src/Internal/Marshaller/TypeFactory.php +++ b/src/Internal/Marshaller/TypeFactory.php @@ -87,7 +87,8 @@ public function detect(?\ReflectionType $type): ?string } foreach ($this->matchers as $matcher) { - if ($result = $matcher($type)) { + $result = $matcher($type); + if ($result !== null) { return $result; } } diff --git a/src/Worker/WorkerOptions.php b/src/Worker/WorkerOptions.php index 9f7ca44d..c24fccc5 100644 --- a/src/Worker/WorkerOptions.php +++ b/src/Worker/WorkerOptions.php @@ -449,7 +449,7 @@ public function withSessionResourceId(?string $identifier): self { $self = clone $this; - $self->sessionResourceId = $identifier ?: null; + $self->sessionResourceId = $identifier === '' ? null : $identifier; return $self; }