Skip to content

Commit 67804b2

Browse files
committed
Add type to $size
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 80da020 commit 67804b2

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,3 @@ parameters:
2525
count: 2
2626
path: src/ShapeRecord.php
2727

28-
-
29-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$size \\(int\\) does not accept mixed\\.$#"
30-
count: 1
31-
path: src/ShapeRecord.php
32-

src/ShapeRecord.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class ShapeRecord
4848
/** @var ShapeFile */
4949
private $shapeFile = null;
5050

51-
/** @var int */
52-
private $size = 0;
51+
private int $size = 0;
5352

5453
private int $read = 0;
5554

@@ -205,12 +204,13 @@ private function loadHeaders(): void
205204
$this->recordNumber = (int) $recordNumber;
206205

207206
// We read the length of the record
208-
$this->size = $this->loadData('N', 4);
209-
if ($this->size === false) {
207+
$size = $this->loadData('N', 4);
208+
if ($size === false) {
210209
return;
211210
}
212211

213-
$this->size = ($this->size * 2) + 8;
212+
$this->size = ($size * 2) + 8;
213+
214214
$shapeType = $this->loadData('V', 4);
215215
if ($shapeType === false) {
216216
return;

0 commit comments

Comments
 (0)