|
1 |
| -<?php |
2 |
| -/** |
3 |
| - * Copyright © 2016 Magento. All rights reserved. |
4 |
| - * See COPYING.txt for license details. |
5 |
| - */ |
6 |
| -namespace Magento\Framework\DataObject; |
7 |
| - |
8 |
| -use Ramsey\Uuid\Uuid; |
9 |
| - |
10 |
| -/** |
11 |
| - * Class IdentityService |
12 |
| - */ |
13 |
| -class IdentityService implements IdentityGeneratorInterface |
14 |
| -{ |
15 |
| - /** |
16 |
| - * @var \Ramsey\Uuid\UuidFactoryInterface |
17 |
| - */ |
18 |
| - private $uuidFactory; |
19 |
| - |
20 |
| - /** |
21 |
| - * IdentityService constructor. |
22 |
| - */ |
23 |
| - public function __construct( |
24 |
| - ) { |
25 |
| - $this->uuidFactory = new \Ramsey\Uuid\UuidFactory(); |
26 |
| - } |
27 |
| - |
28 |
| - /** |
29 |
| - * @inheritDoc |
30 |
| - */ |
31 |
| - public function generateId() |
32 |
| - { |
33 |
| - $uuid = $this->uuidFactory->uuid4(); |
34 |
| - return $uuid->toString(); |
35 |
| - } |
36 |
| - |
37 |
| - /** |
38 |
| - * @inheritDoc |
39 |
| - */ |
40 |
| - public function generateIdForData($data) |
41 |
| - { |
42 |
| - $uuid = $this->uuidFactory->uuid3(Uuid::NAMESPACE_DNS, $data); |
43 |
| - return $uuid->toString(); |
44 |
| - } |
45 |
| -} |
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Copyright © 2016 Magento. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
| 5 | + */ |
| 6 | +namespace Magento\Framework\DataObject; |
| 7 | + |
| 8 | +use Ramsey\Uuid\Uuid; |
| 9 | + |
| 10 | +/** |
| 11 | + * Class IdentityService |
| 12 | + */ |
| 13 | +class IdentityService implements IdentityGeneratorInterface |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @var \Ramsey\Uuid\UuidFactoryInterface |
| 17 | + */ |
| 18 | + private $uuidFactory; |
| 19 | + |
| 20 | + /** |
| 21 | + * IdentityService constructor. |
| 22 | + */ |
| 23 | + public function __construct( |
| 24 | + ) { |
| 25 | + $this->uuidFactory = new \Ramsey\Uuid\UuidFactory(); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * @inheritDoc |
| 30 | + */ |
| 31 | + public function generateId() |
| 32 | + { |
| 33 | + $uuid = $this->uuidFactory->uuid4(); |
| 34 | + return $uuid->toString(); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * @inheritDoc |
| 39 | + */ |
| 40 | + public function generateIdForData($data) |
| 41 | + { |
| 42 | + $uuid = $this->uuidFactory->uuid3(Uuid::NAMESPACE_DNS, $data); |
| 43 | + return $uuid->toString(); |
| 44 | + } |
| 45 | +} |
0 commit comments