Skip to content

Commit 986c2b6

Browse files
committed
Fix psalm issues
1 parent 519065b commit 986c2b6

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

psalm-baseline.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,6 @@
135135
<code>stdClass</code>
136136
</MoreSpecificReturnType>
137137
</file>
138-
<file src="src/Model/BSONIterator.php">
139-
<MixedArgument>
140-
<code>$documentLength</code>
141-
<code>$documentLength</code>
142-
<code><![CDATA[$this->options['typeMap']]]></code>
143-
</MixedArgument>
144-
<MixedAssignment>
145-
<code><![CDATA[$this->position]]></code>
146-
</MixedAssignment>
147-
<MixedOperand>
148-
<code>$documentLength</code>
149-
</MixedOperand>
150-
</file>
151138
<file src="src/Model/ChangeStreamIterator.php">
152139
<MixedArgument>
153140
<code><![CDATA[$reply->cursor->nextBatch]]></code>

src/Model/BSONIterator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use ReturnTypeWillChange;
2525

2626
use function is_array;
27+
use function is_int;
2728
use function sprintf;
2829
use function strlen;
2930
use function substr;
@@ -49,6 +50,7 @@ class BSONIterator implements Iterator
4950

5051
private int $position = 0;
5152

53+
/** @var array{typeMap: array, ...} */
5254
private array $options;
5355

5456
/**
@@ -142,6 +144,7 @@ private function advance(): void
142144
}
143145

144146
[, $documentLength] = unpack('V', substr($this->buffer, $this->position, self::BSON_SIZE));
147+
assert(is_int($documentLength));
145148

146149
if ($this->bufferLength - $this->position < $documentLength) {
147150
throw new UnexpectedValueException(sprintf('Expected %d bytes; %d remaining', $documentLength, $this->bufferLength - $this->position));

0 commit comments

Comments
 (0)