Skip to content

Commit d484396

Browse files
authored
Merge pull request #79 from laminas/3.16.x-merge-up-into-3.17.x_T0pV2HXO
Merge release 3.16.1 into 3.17.x
2 parents 0880e3d + f4f7736 commit d484396

File tree

7 files changed

+23
-70
lines changed

7 files changed

+23
-70
lines changed

psalm-baseline.xml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@
2929
<DocblockTypeContradiction occurrences="1">
3030
<code>! is_array($data) &amp;&amp; ! is_object($data)</code>
3131
</DocblockTypeContradiction>
32-
<InvalidArgument occurrences="2">
33-
<code>$key</code>
34-
<code>$value</code>
35-
</InvalidArgument>
36-
<InvalidPropertyAssignmentValue occurrences="2">
37-
<code>$data</code>
32+
<InvalidPropertyAssignmentValue occurrences="1">
3833
<code>$this-&gt;storage</code>
3934
</InvalidPropertyAssignmentValue>
35+
<MixedArgument occurrences="1">
36+
<code>$v</code>
37+
</MixedArgument>
4038
<MixedAssignment occurrences="1">
4139
<code>$v</code>
4240
</MixedAssignment>
@@ -100,14 +98,12 @@
10098
<ImplementedReturnTypeMismatch occurrences="1">
10199
<code>TValue|int|array{data: TValue|false, priority: int}|false</code>
102100
</ImplementedReturnTypeMismatch>
103-
<InvalidPropertyAssignmentValue occurrences="1">
104-
<code>$this-&gt;values</code>
105-
</InvalidPropertyAssignmentValue>
106101
<LessSpecificReturnStatement occurrences="3">
107102
<code>$array</code>
108103
<code>$value</code>
109104
</LessSpecificReturnStatement>
110-
<MixedArgument occurrences="1">
105+
<MixedArgument occurrences="2">
106+
<code>$item['data']</code>
111107
<code>$item['priority']</code>
112108
</MixedArgument>
113109
<MixedArrayAccess occurrences="2">
@@ -172,32 +168,13 @@
172168
<code>setMetadata</code>
173169
</MissingReturnType>
174170
</file>
175-
<file src="src/Parameters.php">
176-
<InvalidArgument occurrences="3">
177-
<code>$name</code>
178-
<code>$name</code>
179-
<code>$value</code>
180-
</InvalidArgument>
181-
<MixedArgumentTypeCoercion occurrences="1">
182-
<code>$this-&gt;toArray()</code>
183-
</MixedArgumentTypeCoercion>
184-
<MoreSpecificImplementedParamType occurrences="1">
185-
<code>$name</code>
186-
</MoreSpecificImplementedParamType>
187-
</file>
188171
<file src="src/PriorityList.php">
189172
<FalsableReturnStatement occurrences="1">
190173
<code>$node ? $node['data'] : false</code>
191174
</FalsableReturnStatement>
192-
<InvalidArrayOffset occurrences="1">
193-
<code>$this-&gt;items[$name]</code>
194-
</InvalidArrayOffset>
195175
<InvalidFalsableReturnType occurrences="1">
196176
<code>current</code>
197177
</InvalidFalsableReturnType>
198-
<InvalidPropertyAssignmentValue occurrences="1">
199-
<code>$this-&gt;items</code>
200-
</InvalidPropertyAssignmentValue>
201178
<InvalidReturnStatement occurrences="1">
202179
<code>$node ? $node['data'] : false</code>
203180
</InvalidReturnStatement>
@@ -466,11 +443,6 @@
466443
</UndefinedPropertyFetch>
467444
</file>
468445
<file src="test/PriorityListTest.php">
469-
<MixedAssignment occurrences="3">
470-
<code>$orders1[$this-&gt;list-&gt;key()]</code>
471-
<code>$orders2[$key]</code>
472-
<code>$value</code>
473-
</MixedAssignment>
474446
<NullArgument occurrences="5">
475447
<code>null</code>
476448
<code>null</code>

src/ArrayObject.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,8 @@ public function __isset(mixed $key)
108108
/**
109109
* Sets the value at the specified key to value
110110
*
111-
* @template TInputKey of array-key
112-
* @template TInputValue
113-
* @param TInputKey $key
114-
* @param TInputValue $value
115-
* @psalm-self-out ArrayObject<TKey|TInputKey, TValue|TInputValue>
111+
* @param TKey $key
112+
* @param TValue $value
116113
* @return void
117114
*/
118115
public function __set(mixed $key, mixed $value)
@@ -173,9 +170,7 @@ public function &__get(mixed $key)
173170
/**
174171
* Appends the value
175172
*
176-
* @template TInputValue
177-
* @param TInputValue $value
178-
* @psalm-self-out ArrayObject<TKey|int, TValue|TInputValue>
173+
* @param TValue $value
179174
* @return void
180175
*/
181176
public function append(mixed $value)
@@ -207,12 +202,7 @@ public function count()
207202
/**
208203
* Exchange the array for another one.
209204
*
210-
* @template TInputKey of array-key
211-
* @template TInputValue
212-
* // phpcs:disable Generic.Files.LineLength.TooLong
213-
* @param array<TInputKey, TInputValue>|ArrayObject<TInputKey, TInputValue>|ArrayIterator<TInputKey, TInputValue>|object $data
214-
* // phpcs:enable Generic.Files.LineLength.TooLong
215-
* @psalm-self-out ArrayObject<TInputKey, TInputValue>
205+
* @param array<TKey, TValue>|ArrayObject<TKey, TValue>|ArrayIterator<TKey, TValue>|object $data
216206
* @return array<TKey, TValue>
217207
*/
218208
public function exchangeArray($data)

src/FastPriorityQueue.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ public function __unserialize(array $data): void
115115
/**
116116
* Insert an element in the queue with a specified priority
117117
*
118-
* @template TInputValue
119-
* @param TInputValue $value
120-
* @param int $priority
121-
* @psalm-self-out FastPriorityQueue<TValue|TInputValue>
118+
* @param TValue $value
119+
* @param int $priority
122120
* @return void
123121
*/
124122
public function insert(mixed $value, $priority)

src/Parameters.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use function parse_str;
1212

1313
/**
14-
* @template TKey
14+
* @template TKey of array-key
1515
* @template TValue
1616
* @template-extends PhpArrayObject<TKey, TValue>
1717
* @template-implements ParametersInterface<TKey, TValue>
@@ -37,10 +37,7 @@ public function __construct(?array $values = null)
3737
/**
3838
* Populate from native PHP array
3939
*
40-
* @template TInputKey of array-key
41-
* @template TInputValue
42-
* @param array<TInputKey, TInputValue> $values
43-
* @psalm-self-out Parameters<TInputKey, TInputValue>
40+
* @param array<TKey, TValue> $values
4441
* @return void
4542
*/
4643
public function fromArray(array $values)
@@ -52,7 +49,6 @@ public function fromArray(array $values)
5249
* Populate from query string
5350
*
5451
* @param string $string
55-
* @psalm-self-out Parameters<array-key, mixed>
5652
* @return void
5753
*/
5854
public function fromString($string)
@@ -115,11 +111,8 @@ public function get($name, $default = null)
115111
}
116112

117113
/**
118-
* @template TInputKey of array-key
119-
* @template TInputValue
120-
* @param TInputKey $name
121-
* @param TInputValue $value
122-
* @psalm-self-out Parameters<TKey|TInputKey, TValue|TInputValue>
114+
* @param TKey $name
115+
* @param TValue $value
123116
* @return $this
124117
*/
125118
public function set($name, $value)

src/ParametersInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(?array $values = null);
3333
*
3434
* Allow deserialization from standard array
3535
*
36-
* @param array $values
36+
* @param array<TKey, TValue> $values
3737
* @return mixed
3838
*/
3939
public function fromArray(array $values);

src/PriorityList.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,9 @@ class PriorityList implements Iterator, Countable
6969
/**
7070
* Insert a new item.
7171
*
72-
* @template TInputKey of string
73-
* @template TInputValue
74-
* @param TInputKey $name
75-
* @param TInputValue $value
76-
* @param int $priority
77-
* @psalm-self-out PriorityList<TInputKey|TKey, TInputValue|TValue>
72+
* @param TKey $name
73+
* @param TValue $value
74+
* @param int $priority
7875
* @return void
7976
*/
8077
public function insert($name, mixed $value, $priority = 0)

test/ArrayObjectTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function testConstructorParameters(): void
4848

4949
public function testStdPropList(): void
5050
{
51+
/** @var ArrayObject<string, string> $ar */
5152
$ar = new ArrayObject();
5253
$ar->foo = 'bar';
5354
$ar->bar = 'baz';
@@ -96,6 +97,7 @@ public function testArrayAsProps(): void
9697

9798
public function testAppend(): void
9899
{
100+
/** @var ArrayObject<int, string> $ar */
99101
$ar = new ArrayObject(['one', 'two']);
100102
self::assertEquals(2, $ar->count());
101103

@@ -131,6 +133,7 @@ public function testCountable(): void
131133

132134
public function testExchangeArray(): void
133135
{
136+
/** @var ArrayObject<string, string> $ar */
134137
$ar = new ArrayObject(['foo' => 'bar']);
135138
$old = $ar->exchangeArray(['bar' => 'baz']);
136139

0 commit comments

Comments
 (0)