File tree Expand file tree Collapse file tree 6 files changed +20
-40
lines changed Expand file tree Collapse file tree 6 files changed +20
-40
lines changed Original file line number Diff line number Diff line change @@ -6,37 +6,21 @@ interface UuidExtractorInterface
6
6
{
7
7
/**
8
8
* Creates a UUID from a string UUID.
9
- *
10
- * @param string $source
11
- *
12
- * @return string
13
9
*/
14
- public function fromString (string $ source ): string ;
10
+ public function fromString (string $ uuid ): string ;
15
11
16
12
/**
17
13
* Creates a UUID from a 16-byte string.
18
- *
19
- * @param string $bytes
20
- *
21
- * @return string
22
14
*/
23
15
public function fromBytes (string $ bytes ): string ;
24
16
25
17
/**
26
18
* Creates a UUID from a string integer.
27
- *
28
- * @param string $integer
29
- *
30
- * @return string
31
19
*/
32
20
public function fromInteger (string $ integer ): string ;
33
21
34
22
/**
35
23
* Creates a UUID from a DateTimeInterface instance
36
- *
37
- * @param \DateTimeInterface $dateTime
38
- *
39
- * @return string
40
24
*/
41
25
public function fromDatetime (\DateTimeInterface $ dateTime ): string ;
42
26
}
Original file line number Diff line number Diff line change @@ -38,9 +38,6 @@ public function v5(string $namespace): string
38
38
return Uuid::uuid5 ($ this ->getUuidConstant ($ namespace ), php_uname ('n ' ))->toString ();
39
39
}
40
40
41
- /**
42
- * {@inheritDoc}
43
- */
44
41
public function v6 (): string
45
42
{
46
43
return Uuid::uuid6 ()->toString ();
Original file line number Diff line number Diff line change 5
5
use Micro \Plugin \Uuid \Business \UuidExtractorFactoryInterface ;
6
6
use Micro \Plugin \Uuid \Business \UuidGeneratorFactoryInterface ;
7
7
8
- class UuidFacade implements UuidFacadeInterface
8
+ readonly class UuidFacade implements UuidFacadeInterface
9
9
{
10
10
/**
11
11
* @param UuidGeneratorFactoryInterface $generatorFactory
12
12
* @param UuidExtractorFactoryInterface $extractorFactory
13
13
*/
14
14
public function __construct (
15
- private readonly UuidGeneratorFactoryInterface $ generatorFactory ,
16
- private readonly UuidExtractorFactoryInterface $ extractorFactory
17
- )
18
- {
15
+ private UuidGeneratorFactoryInterface $ generatorFactory ,
16
+ private UuidExtractorFactoryInterface $ extractorFactory
17
+ ) {
19
18
}
20
19
21
20
/**
@@ -53,9 +52,9 @@ public function v5(string $namespace): string
53
52
/**
54
53
* {@inheritDoc}
55
54
*/
56
- public function fromString (string $ source ): string
55
+ public function fromString (string $ uuid ): string
57
56
{
58
- return $ this ->extractorFactory ->create ()->fromString ($ source );
57
+ return $ this ->extractorFactory ->create ()->fromString ($ uuid );
59
58
}
60
59
61
60
/**
Original file line number Diff line number Diff line change 5
5
use Micro \Plugin \Uuid \Business \UuidExtractorFactoryInterface ;
6
6
use Micro \Plugin \Uuid \Business \UuidGeneratorFactoryInterface ;
7
7
8
- class UuidFacadeFactory implements UuidFacadeFactoryInterface
8
+ readonly class UuidFacadeFactory implements UuidFacadeFactoryInterface
9
9
{
10
10
/**
11
11
* @param UuidGeneratorFactoryInterface $generatorFactory
12
12
* @param UuidExtractorFactoryInterface $extractorFactory
13
13
*/
14
14
public function __construct (
15
- private readonly UuidGeneratorFactoryInterface $ generatorFactory ,
16
- private readonly UuidExtractorFactoryInterface $ extractorFactory
15
+ private UuidGeneratorFactoryInterface $ generatorFactory ,
16
+ private UuidExtractorFactoryInterface $ extractorFactory
17
17
)
18
18
{
19
19
}
Original file line number Diff line number Diff line change 14
14
*/
15
15
class UuidPlugin implements DependencyProviderInterface
16
16
{
17
- /**
18
- * {@inheritDoc}
19
- */
20
17
public function provideDependencies (Container $ container ): void
21
18
{
22
19
$ container ->register (UuidFacadeInterface::class, function () {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " micro/plugin-uuid" ,
3
3
"description" : " Micro Framework - plugin for UUID support" ,
4
- "type" : " micro-plugin" ,
5
4
"license" : " MIT" ,
6
- "autoload" : {
7
- "psr-4" : {
8
- "Micro\\ Plugin\\ Uuid\\ " : " /"
9
- }
10
- },
5
+ "type" : " micro-plugin" ,
11
6
"authors" : [
12
7
{
13
8
"name" : " Stanislau.Komar" ,
18
13
"micro/kernel" : " ^2.0" ,
19
14
"ramsey/uuid" : " ^4.2"
20
15
},
21
- "minimum-stability" : " dev"
16
+ "minimum-stability" : " dev" ,
17
+ "autoload" : {
18
+ "psr-4" : {
19
+ "Micro\\ Plugin\\ Uuid\\ " : " /"
20
+ }
21
+ },
22
+ "config" : {
23
+ "sort-packages" : true
24
+ }
22
25
}
You can’t perform that action at this time.
0 commit comments