Skip to content

Commit

Permalink
Fix static analysis issues (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk authored Jan 18, 2024
1 parent ba2d5c3 commit 9de474f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.19.0@06b71be009a6bd6d81b9811855d6629b9fe90e1b">
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<file src="src/Activity.php">
<ImplicitToStringCast>
<code>$type</code>
Expand Down Expand Up @@ -921,7 +921,7 @@
<MissingTemplateParam>
<code>\IteratorAggregate</code>
</MissingTemplateParam>
</file>c
</file>
<file src="src/Internal/Repository/ArrayRepository.php">
<InvalidReturnStatement>
<code><![CDATA[$this->entries[$id] ?? null]]></code>
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Schedule/Spec/ScheduleSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion src/Internal/Marshaller/TypeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Worker/WorkerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public function withSessionResourceId(?string $identifier): self
{
$self = clone $this;

$self->sessionResourceId = $identifier ?: null;
$self->sessionResourceId = $identifier === '' ? null : $identifier;

return $self;
}
Expand Down

0 comments on commit 9de474f

Please sign in to comment.