Merge branch 'pawel-slowik-fix-static-analysis'

This commit is contained in:
Ben Ramsey
2021-08-06 16:16:17 -05:00
3 changed files with 28 additions and 4 deletions
+14 -2
View File
@@ -27,5 +27,17 @@ parameters:
message: "#^Function uuid_parse\\(\\) has parameter \\$uuid with no typehint specified\\.$#"
count: 1
path: ./tests/phpstan-bootstrap.php
- '#^Call to static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) on a separate line has no effect\.$#'
- '#^Call to method [a-zA-Z0-9\\_]+::[a-zA-Z0-9]+\(\) on a separate line has no effect\.$#'
-
message: "#^Call to static method Ramsey\\\\Uuid\\\\.+ on a separate line has no effect\\.$#"
paths:
- ./tests/*Test.php
- ./tests/benchmark/*Bench.php
-
message: "#^Call to method Ramsey\\\\Uuid\\\\.+ on a separate line has no effect\\.$#"
paths:
- ./tests/Builder/*Test.php
- ./tests/Converter/*Test.php
- ./tests/Generator/*Test.php
- ./tests/Guid/*Test.php
- ./tests/Nonstandard/*Test.php
- ./tests/Rfc4122/*Test.php
+7 -1
View File
@@ -53,6 +53,7 @@ class BuilderCollection extends AbstractCollection
* a UuidInterface instance
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
* @psalm-suppress RedundantConditionGivenDocblockType
*/
public function unserialize($serialized): void
{
@@ -69,6 +70,11 @@ class BuilderCollection extends AbstractCollection
],
]);
$this->data = $data;
$this->data = array_filter(
$data,
function ($unserialized): bool {
return $unserialized instanceof UuidBuilderInterface;
}
);
}
}
+7 -1
View File
@@ -37,6 +37,7 @@ class NodeProviderCollection extends AbstractCollection
* a UuidInterface instance
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
* @psalm-suppress RedundantConditionGivenDocblockType
*/
public function unserialize($serialized): void
{
@@ -50,6 +51,11 @@ class NodeProviderCollection extends AbstractCollection
],
]);
$this->data = $data;
$this->data = array_filter(
$data,
function ($unserialized): bool {
return $unserialized instanceof NodeProviderInterface;
}
);
}
}