PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
media-cloud-sync / includes / sdk / google / ramsey / uuid / src / Builder / BuilderCollection.php

BuilderCollection.php in Media Cloud Sync 1.4.2, at includes/sdk/google/ramsey/uuid/src/Builder/BuilderCollection.php

59 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This file is part of the ramsey/uuid library
5 *
6 * For the full copyright and license information, please view the LICENSE
7 * file that was distributed with this source code.
8 *
9 * @copyright Copyright (c) Ben Ramsey <[email protected]>
10 * @license http://opensource.org/licenses/MIT MIT
11 */
12 declare (strict_types=1);
13 namespace Dudlewebs\WPMCS\GCP\Ramsey\Uuid\Builder;
14
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 use Traversable;
24 /**
25 * A collection of UuidBuilderInterface objects
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 *
32 * @extends AbstractCollection<UuidBuilderInterface>
33 */
34 class BuilderCollection extends AbstractCollection
35 {
36 public function getType() : string
37 {
38 return UuidBuilderInterface::class;
39 }
40 public function getIterator() : Traversable
41 {
42 return parent::getIterator();
43 }
44 /**
45 * Re-constructs the object from its serialized form
46 *
47 * @param string $serialized The serialized PHP string to unserialize into a UuidInterface instance
48 */
49 public function unserialize($serialized) : void
50 {
51 /** @var array<array-key, UuidBuilderInterface> $data */
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 */
55 return $unserialized instanceof UuidBuilderInterface;
56 });
57 }
58 }
59