diff --git a/phpstan-tests.neon b/phpstan-tests.neon index 94ee0fa..92922a1 100644 --- a/phpstan-tests.neon +++ b/phpstan-tests.neon @@ -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 diff --git a/src/Builder/BuilderCollection.php b/src/Builder/BuilderCollection.php index bb52e26..1d7feb3 100644 --- a/src/Builder/BuilderCollection.php +++ b/src/Builder/BuilderCollection.php @@ -69,6 +69,11 @@ class BuilderCollection extends AbstractCollection ], ]); - $this->data = $data; + $this->data = array_filter( + $data, + function ($unserialized): bool { + return $unserialized instanceof UuidBuilderInterface; + } + ); } } diff --git a/src/Provider/Node/NodeProviderCollection.php b/src/Provider/Node/NodeProviderCollection.php index 5575b5b..7fc8feb 100644 --- a/src/Provider/Node/NodeProviderCollection.php +++ b/src/Provider/Node/NodeProviderCollection.php @@ -50,6 +50,11 @@ class NodeProviderCollection extends AbstractCollection ], ]); - $this->data = $data; + $this->data = array_filter( + $data, + function ($unserialized): bool { + return $unserialized instanceof NodeProviderInterface; + } + ); } }