Prevent PHPStan error: 'Uuid::fromString() on a separate line has no effect.' (#552)

Co-authored-by: Ben Ramsey <ben@benramsey.com>
This commit is contained in:
Markus Staab
2024-05-18 21:34:25 +02:00
committed by GitHub
parent 9955b08d13
commit 558009ce4c
+9 -2
View File
@@ -19,6 +19,7 @@ use DateTimeInterface;
use Ramsey\Uuid\Codec\CodecInterface;
use Ramsey\Uuid\Converter\NumberConverterInterface;
use Ramsey\Uuid\Converter\TimeConverterInterface;
use Ramsey\Uuid\Exception\InvalidArgumentException;
use Ramsey\Uuid\Exception\UnsupportedOperationException;
use Ramsey\Uuid\Fields\FieldsInterface;
use Ramsey\Uuid\Lazy\LazyUuidFromString;
@@ -436,9 +437,10 @@ class Uuid implements UuidInterface
* @return UuidInterface A UuidInterface instance created from a binary
* string representation
*
* @throws InvalidArgumentException
*
* @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants,
* but under constant factory setups, this method operates in functionally pure manners
*
* @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive
* havoc across all consumers: that should never happen, and
* is generally to be discouraged. Until the factory is kept
@@ -474,9 +476,10 @@ class Uuid implements UuidInterface
* @return UuidInterface A UuidInterface instance created from a hexadecimal
* string representation
*
* @throws InvalidArgumentException
*
* @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants,
* but under constant factory setups, this method operates in functionally pure manners
*
* @psalm-suppress ImpureStaticProperty we know that the factory being replaced can lead to massive
* havoc across all consumers: that should never happen, and
* is generally to be discouraged. Until the factory is kept
@@ -523,6 +526,8 @@ class Uuid implements UuidInterface
* @return UuidInterface A UuidInterface instance created from the Hexadecimal
* object representing a hexadecimal number
*
* @throws InvalidArgumentException
*
* @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants,
* but under constant factory setups, this method operates in functionally pure manners
* @psalm-suppress MixedInferredReturnType,MixedReturnStatement
@@ -550,6 +555,8 @@ class Uuid implements UuidInterface
* @return UuidInterface A UuidInterface instance created from the string
* representation of a 128-bit integer
*
* @throws InvalidArgumentException
*
* @psalm-pure note: changing the internal factory is an edge case not covered by purity invariants,
* but under constant factory setups, this method operates in functionally pure manners
*/