From 1d38f0097dd4f87ff3cfe4664e4cc3df258a2a85 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 7 Jul 2022 17:00:12 +0200 Subject: [PATCH] Applying type improvements brought in by newer psalm version --- psalm-baseline.xml | 30 +++++++-------------- psalm.xml.dist | 2 +- src/StringWrapper/AbstractStringWrapper.php | 2 +- test/SplQueueTest.php | 6 +++-- 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index aaf4bc7c..029329ba 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + ! is_array($options) && ! $options instanceof Traversable @@ -61,35 +61,17 @@ - - ! is_array($iterator) && ! $iterator instanceof Traversable - $callback - - $array[$key] - $array[$key] - $array[$key] - $array[$key] - - + $a[$key] $a[$key] $a[$key] $a[] - $array[$key] $h - $key - $value $value - - array - - - $iterator->toArray() - @@ -174,7 +156,7 @@ - ! is_array($spec) && ! $spec instanceof Traversable + gettype($spec) is_scalar($key) @@ -192,6 +174,9 @@ $value + + is_object($spec) + @@ -568,6 +553,9 @@ + + assertSame + $unserialized $unserialized diff --git a/psalm.xml.dist b/psalm.xml.dist index c28af9f3..4f1921c0 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -1,6 +1,6 @@ */ protected $queue; protected function setUp(): void { - $this->queue = new SplQueue(); + /** @var SplQueue $splQueue */ + $splQueue = new SplQueue(); + $this->queue = $splQueue; $this->queue->push('foo'); $this->queue->push('bar'); $this->queue->push('baz');