Skip to content

Commit 0173841

Browse files
authored
Merge pull request #114 from laminas/renovate/lock-file-maintenance
Lock file maintenance, minor type inference improvements
2 parents 4b6df85 + 9c7c2a2 commit 0173841

File tree

8 files changed

+214
-219
lines changed

8 files changed

+214
-219
lines changed

composer.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@
3838
"laminas/laminas-stdlib": "^3.0"
3939
},
4040
"require-dev": {
41-
"laminas/laminas-cache": "^3.11.0",
41+
"laminas/laminas-cache": "^3.12.0",
4242
"laminas/laminas-cache-storage-adapter-memory": "^2.3.0",
43-
"laminas/laminas-cache-storage-deprecated-factory": "^1.1",
43+
"laminas/laminas-cache-storage-deprecated-factory": "^1.2",
4444
"laminas/laminas-coding-standard": "~2.5.0",
4545
"laminas/laminas-config": "^3.9.0",
46-
"laminas/laminas-eventmanager": "^3.12",
47-
"laminas/laminas-filter": "^2.33",
48-
"laminas/laminas-validator": "^2.41",
49-
"laminas/laminas-view": "^2.32",
50-
"phpunit/phpunit": "^10.4.2",
46+
"laminas/laminas-eventmanager": "^3.13",
47+
"laminas/laminas-filter": "^2.34",
48+
"laminas/laminas-validator": "^2.46",
49+
"laminas/laminas-view": "^2.33",
50+
"phpunit/phpunit": "^10.5.5",
5151
"psalm/plugin-phpunit": "^0.18.4",
52-
"vimeo/psalm": "^5.15.0"
52+
"vimeo/psalm": "^5.18.0"
5353
},
5454
"conflict": {
5555
"laminas/laminas-view": "<2.20.0",

composer.lock

+193-166
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

psalm-baseline.xml

+4-36
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
2+
<files psalm-version="5.18.0@b113f3ed0259fd6e212d87c3df80eec95a6abf19">
33
<file src="src/Exception/ExtensionNotLoadedException.php">
44
<UnusedClass>
55
<code>ExtensionNotLoadedException</code>
@@ -19,40 +19,21 @@
1919
</MixedReturnStatement>
2020
</file>
2121
<file src="src/Filter/Alnum.php">
22-
<DocblockTypeContradiction>
23-
<code><![CDATA[! is_scalar($value) && ! is_array($value)]]></code>
24-
</DocblockTypeContradiction>
2522
<MixedArgumentTypeCoercion>
2623
<code>$value</code>
2724
</MixedArgumentTypeCoercion>
28-
<MixedReturnStatement>
29-
<code>$value</code>
30-
</MixedReturnStatement>
31-
<MoreSpecificImplementedParamType>
32-
<code>$value</code>
33-
</MoreSpecificImplementedParamType>
3425
<PossiblyInvalidArgument>
3526
<code>$allowWhiteSpaceOrOptions</code>
3627
<code>$allowWhiteSpaceOrOptions</code>
3728
</PossiblyInvalidArgument>
3829
<RedundantCastGivenDocblockType>
3930
<code>(bool) $flag</code>
40-
<code>(string) $value</code>
4131
</RedundantCastGivenDocblockType>
4232
</file>
4333
<file src="src/Filter/Alpha.php">
44-
<DocblockTypeContradiction>
45-
<code><![CDATA[! is_scalar($value) && ! is_array($value)]]></code>
46-
</DocblockTypeContradiction>
47-
<MixedArgumentTypeCoercion>
48-
<code>$value</code>
49-
</MixedArgumentTypeCoercion>
50-
<MixedReturnStatement>
51-
<code>$value</code>
52-
</MixedReturnStatement>
53-
<MoreSpecificImplementedParamType>
34+
<ArgumentTypeCoercion>
5435
<code>$value</code>
55-
</MoreSpecificImplementedParamType>
36+
</ArgumentTypeCoercion>
5637
</file>
5738
<file src="src/Filter/NumberParse.php">
5839
<RedundantCastGivenDocblockType>
@@ -333,10 +314,6 @@
333314
</UnnecessaryVarAnnotation>
334315
</file>
335316
<file src="src/Translator/TextDomain.php">
336-
<MixedArgumentTypeCoercion>
337-
<code><![CDATA[$textDomain->getArrayCopy()]]></code>
338-
<code><![CDATA[$this->getArrayCopy()]]></code>
339-
</MixedArgumentTypeCoercion>
340317
<PossiblyNullArgument>
341318
<code><![CDATA[$textDomain->getPluralRule()]]></code>
342319
</PossiblyNullArgument>
@@ -491,9 +468,6 @@
491468
</MixedAssignment>
492469
</file>
493470
<file src="src/Validator/Alnum.php">
494-
<PossiblyInvalidArgument>
495-
<code>$value</code>
496-
</PossiblyInvalidArgument>
497471
<RedundantCastGivenDocblockType>
498472
<code>(bool) $allowWhiteSpace</code>
499473
<code>(bool) $allowWhiteSpace</code>
@@ -717,17 +691,11 @@
717691
</PossiblyUnusedMethod>
718692
</file>
719693
<file src="test/Filter/AlnumTest.php">
720-
<MixedArgument>
721-
<code>$input</code>
722-
</MixedArgument>
723694
<PossiblyUnusedMethod>
724695
<code>returnUnfilteredDataProvider</code>
725696
</PossiblyUnusedMethod>
726697
</file>
727698
<file src="test/Filter/AlphaTest.php">
728-
<MixedArgument>
729-
<code>$input</code>
730-
</MixedArgument>
731699
<PossiblyUnusedMethod>
732700
<code>returnUnfilteredDataProvider</code>
733701
</PossiblyUnusedMethod>
@@ -741,8 +709,8 @@
741709
</file>
742710
<file src="test/Filter/NumberParseTest.php">
743711
<PossiblyUnusedMethod>
744-
<code>formattedToNumberProvider</code>
745712
<code>formatNonNumberProvider</code>
713+
<code>formattedToNumberProvider</code>
746714
</PossiblyUnusedMethod>
747715
</file>
748716
<file src="test/TestAsset/ModuleEventInterface.php">

src/Filter/Alnum.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public function getAllowWhiteSpace()
7373
*
7474
* Returns $value as string with all non-alphanumeric characters removed
7575
*
76-
* @param string|array $value
77-
* @return string|array
76+
* @param mixed $value
77+
* @return ($value is scalar|list<scalar> ? string|list<scalar> : mixed)
7878
*/
7979
public function filter($value)
8080
{

src/Filter/Alpha.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class Alpha extends Alnum
1717
*
1818
* Returns the string $value, removing all but alphabetic characters
1919
*
20-
* @param string|array $value
21-
* @return string|array
20+
* @param mixed $value
21+
* @return ($value is scalar|list<scalar> ? string|list<scalar> : mixed)
2222
*/
2323
public function filter($value)
2424
{

src/Translator/TextDomain.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Text domain.
1313
*
14-
* @template TKey
14+
* @template TKey of array-key
1515
* @template TValue
1616
* @extends ArrayObject<TKey, TValue>
1717
*/
@@ -90,7 +90,7 @@ public static function getDefaultPluralRule()
9090
*
9191
* @return $this
9292
* @throws Exception\RuntimeException
93-
* @template TNewKey
93+
* @template TNewKey of array-key
9494
* @template TNewValue
9595
* @param self<TNewKey, TNewValue> $textDomain
9696
* @psalm-self-out self<TKey|TNewKey, TValue|TNewValue>

src/Translator/Translator.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
use Traversable;
1717

1818
use function array_shift;
19-
use function gettype;
19+
use function get_debug_type;
2020
use function is_array;
2121
use function is_file;
22-
use function is_object;
2322
use function is_string;
2423
use function md5;
2524
use function rtrim;
@@ -125,7 +124,7 @@ public static function factory($options)
125124
throw new Exception\InvalidArgumentException(sprintf(
126125
'%s expects an array or Traversable object; received "%s"',
127126
__METHOD__,
128-
is_object($options) ? $options::class : gettype($options)
127+
get_debug_type($options),
129128
));
130129
}
131130

test/Validator/DateTimeTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
class DateTimeTest extends TestCase
1919
{
2020
private DateTimeValidator $validator;
21+
/** @var non-empty-string */
2122
private string $timezone;
2223

2324
protected function setUp(): void

0 commit comments

Comments
 (0)