← All changes
|
includes/sdk/google/ramsey/uuid/src/Builder/BuilderCollection.php
+21
-24
1.1.0
→
1.4.2
View file →
| @@ -9,36 +9,36 @@ | ||
| 9 | 9 | * @copyright Copyright (c) Ben Ramsey <[email protected]> |
| 10 | 10 | * @license http://opensource.org/licenses/MIT MIT |
| 11 | 11 | */ |
| 12 | 12 | declare (strict_types=1); |
| 13 | -namespace Dudlewebs\WPMCS\Ramsey\Uuid\Builder; | |
| 13 | +namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Builder; | |
| 14 | 14 | |
| 15 | -use Dudlewebs\WPMCS\Ramsey\Collection\AbstractCollection; | |
| 16 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\Number\GenericNumberConverter; | |
| 17 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\Time\GenericTimeConverter; | |
| 18 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Converter\Time\PhpTimeConverter; | |
| 19 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Guid\GuidBuilder; | |
| 20 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Math\BrickMathCalculator; | |
| 21 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; | |
| 22 | -use Dudlewebs\WPMCS\Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; | |
| 15 | +use Dudlewebs\WPMCS\GCP\Ramsey\Collection\AbstractCollection; | |
| 16 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\Number\GenericNumberConverter; | |
| 17 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\Time\GenericTimeConverter; | |
| 18 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Converter\Time\PhpTimeConverter; | |
| 19 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Guid\GuidBuilder; | |
| 20 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Math\BrickMathCalculator; | |
| 21 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Nonstandard\UuidBuilder as NonstandardUuidBuilder; | |
| 22 | +use Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; | |
| 23 | 23 | use Traversable; |
| 24 | 24 | /** |
| 25 | 25 | * A collection of UuidBuilderInterface objects |
| 26 | 26 | * |
| 27 | + * @deprecated this class has been deprecated and will be removed in 5.0.0. The use-case for this class comes from a | |
| 28 | + * pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: | |
| 29 | + * that is no longer necessary, now that you can safely verify your code to be correct, and use more generic types | |
| 30 | + * like `iterable<T>` instead. | |
| 31 | + * | |
| 27 | 32 | * @extends AbstractCollection<UuidBuilderInterface> |
| 28 | 33 | */ |
| 29 | 34 | class BuilderCollection extends AbstractCollection |
| 30 | 35 | { |
| 31 | - public function getType(): string | |
| 36 | + public function getType() : string | |
| 32 | 37 | { |
| 33 | 38 | return UuidBuilderInterface::class; |
| 34 | 39 | } |
| 35 | - /** | |
| 36 | - * @psalm-mutation-free | |
| 37 | - * @psalm-suppress ImpureMethodCall | |
| 38 | - * @psalm-suppress InvalidTemplateParam | |
| 39 | - */ | |
| 40 | - public function getIterator(): Traversable | |
| 40 | + public function getIterator() : Traversable | |
| 41 | 41 | { |
| 42 | 42 | return parent::getIterator(); |
| 43 | 43 | } |
| 44 | 44 | /** |
| @@ -43,19 +43,16 @@ | ||
| 43 | 43 | } |
| 44 | 44 | /** |
| 45 | 45 | * Re-constructs the object from its serialized form |
| 46 | 46 | * |
| 47 | - * @param string $serialized The serialized PHP string to unserialize into | |
| 48 | - * a UuidInterface instance | |
| 49 | - * | |
| 50 | - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint | |
| 51 | - * @psalm-suppress RedundantConditionGivenDocblockType | |
| 47 | + * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance | |
| 52 | 48 | */ |
| 53 | - public function unserialize($serialized): void | |
| 49 | + public function unserialize($serialized) : void | |
| 54 | 50 | { |
| 55 | 51 | /** @var array<array-key, UuidBuilderInterface> $data */ |
| 56 | - $data = unserialize($serialized, ['allowed_classes' => [BrickMathCalculator::class, GenericNumberConverter::class, GenericTimeConverter::class, GuidBuilder::class, NonstandardUuidBuilder::class, PhpTimeConverter::class, Rfc4122UuidBuilder::class]]); | |
| 57 | - $this->data = array_filter($data, function ($unserialized): bool { | |
| 52 | + $data = \unserialize($serialized, ['allowed_classes' => [BrickMathCalculator::class, GenericNumberConverter::class, GenericTimeConverter::class, GuidBuilder::class, NonstandardUuidBuilder::class, PhpTimeConverter::class, Rfc4122UuidBuilder::class]]); | |
| 53 | + $this->data = \array_filter($data, function ($unserialized) : bool { | |
| 54 | + /** @phpstan-ignore instanceof.alwaysTrue */ | |
| 58 | 55 | return $unserialized instanceof UuidBuilderInterface; |
| 59 | 56 | }); |
| 60 | 57 | } |
| 61 | 58 | } |