PluginProbe
Media Cloud Sync / 1.0.3
Media Cloud Sync v1.0.3
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 1.2.9 All 35 releases
media-cloud-sync / includes / sdk / google / ramsey / uuid / src / Builder / BuilderCollection.php

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

62 lines 2.3 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 <ben@benramsey.com>
10 * @license http://opensource.org/licenses/MIT MIT
11 */
12 declare (strict_types=1);
13 namespace Dudlewebs\WPMCS\Ramsey\Uuid\Builder;
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;
23 use Traversable;
24 /**
25 * A collection of UuidBuilderInterface objects
26 *
27 * @extends AbstractCollection<UuidBuilderInterface>
28 */
29 class BuilderCollection extends AbstractCollection
30 {
31 public function getType(): string
32 {
33 return UuidBuilderInterface::class;
34 }
35 /**
36 * @psalm-mutation-free
37 * @psalm-suppress ImpureMethodCall
38 * @psalm-suppress InvalidTemplateParam
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
48 * a UuidInterface instance
49 *
50 * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
51 * @psalm-suppress RedundantConditionGivenDocblockType
52 */
53 public function unserialize($serialized): void
54 {
55 /** @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 {
58 return $unserialized instanceof UuidBuilderInterface;
59 });
60 }
61 }
62