8000 [Uid] Realign inspect commands labels · symfony/symfony@9cf7fbc · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cf7fbc

Browse files
committed
[Uid] Realign inspect commands labels
1 parent 1fac9ee commit 9cf7fbc

File tree

4 files changed

+101
-101
lines changed

4 files changed

+101
-101
lines changed

src/Symfony/Component/Uid/Command/InspectUlidCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
6262
}
6363

6464
$io->table(['Label', 'Value'], [
65-
['Canonical (Base 32)', (string) $ulid],
66-
['Base 58', $ulid->toBase58()],
67-
['RFC 4122', $ulid->toRfc4122()],
65+
['toBase32 (canonical)', (string) $ulid],
66+
['toBase58', $ulid->toBase58()],
67+
['toRfc4122', $ulid->toRfc4122()],
6868
new TableSeparator(),
69-
['Timestamp', ($ulid->getDateTime())->format('Y-m-d H:i:s.v')],
69+
['Time', ($ulid->getDateTime())->format('Y-m-d H:i:s.v \U\T\C')],
7070
]);
7171

7272
return 0;

src/Symfony/Component/Uid/Command/InspectUuidCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
7272

7373
$rows = [
7474
['Version', $version],
75-
['Canonical (RFC 4122)', (string) $uuid],
76-
['Base 58', $uuid->toBase58()],
77-
['Base 32', $uuid->toBase32()],
75+
['toRfc4122 (canonical)', (string) $uuid],
76+
['toBase58', $uuid->toBase58()],
77+
['toBase32', $uuid->toBase32()],
7878
];
7979

8080
if ($uuid instanceof UuidV1 || $uuid instanceof UuidV6) {
8181
$rows[] = new TableSeparator();
82-
$rows[] = ['Timestamp', $uuid->getDateTime()->format('Y-m-d H:i:s.u')];
82+
$rows[] = ['Time', $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C')];
8383
}
8484

8585
$io->table(['Label', 'Value'], $rows);

src/Symfony/Component/Uid/Tests/Command/InspectUlidCommandTest.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public function test()
3131
] as $ulid) {
3232
$this->assertSame(0, $commandTester->execute(['ulid' => $ulid]));
3333
$this->assertSame(<<<EOF
34-
--------------------- --------------------------------------
35-
Label Value
36-
--------------------- --------------------------------------
37-
Canonical (Base 32) 01E439TP9XJZ9RPFH3T1PYBCR8
38-
Base 58 1BKocMc5BnrVcuq2ti4Eqm
39-
RFC 4122 0171069d-593d-97d3-8b3e-23d06de5b308
40-
--------------------- --------------------------------------
41-
Timestamp 2020-03-23 08:58:27.517
42-
--------------------- --------------------------------------
34+
---------------------- --------------------------------------
35+
Label Value
36+
---------------------- --------------------------------------
37+
toBase32 (canonical) 01E439TP9XJZ9RPFH3T1PYBCR8
38+
toBase58 1BKocMc5BnrVcuq2ti4Eqm
39+
toRfc4122 0171069d-593d-97d3-8b3e-23d06de5b308
40+
---------------------- --------------------------------------
41+
Time 2020-03-23 08:58:27.517 UTC
42+
---------------------- --------------------------------------
4343
4444
4545
EOF

src/Symfony/Component/Uid/Tests/Command/InspectUuidCommandTest.php

+84-84
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public function testNil()
3131

3232
$this->assertSame(0, $commandTester->execute(['uuid' => '00000000-0000-0000-0000-000000000000']));
3333
$this->assertSame(<<<EOF
34-
---------------------- --------------------------------------
35-
Label Value
36-
---------------------- --------------------------------------
37-
Version nil
38-
Canonical (RFC 4122) 00000000-0000-0000-0000-000000000000
39-
Base 58 1111111111111111111111
40-
Base 32 00000000000000000000000000
41-
---------------------- --------------------------------------
34+
----------------------- --------------------------------------
35+
Label Value
36+
----------------------- --------------------------------------
37+
Version nil
38+
toRfc4122 (canonical) 00000000-0000-0000-0000-000000000000
39+
toBase58 1111111111111111111111
40+
toBase32 00000000000000000000000000
41+
----------------------- --------------------------------------
4242
4343
4444
EOF
@@ -51,59 +51,59 @@ public function testUnknown()
5151

5252
$this->assertSame(0, $commandTester->execute(['uuid' => '461cc9b9-2397-0dba-91e9-33af4c63f7ec']));
5353
$this->assertSame(<<<EOF
54-
---------------------- --------------------------------------
55-
Label Value
56-
---------------------- --------------------------------------
57-
Version unknown
58-
Canonical (RFC 4122) 461cc9b9-2397-0dba-91e9-33af4c63f7ec
59-
Base 58 9f9nftX6dw4oVPm5uT17um
60-
Base 32 263K4VJ8WQ1PX93T9KNX667XZC
61-
---------------------- --------------------------------------
54+
----------------------- --------------------------------------
55+
Label Value
56+
----------------------- --------------------------------------
57+
Version unknown
58+
toRfc4122 (canonical) 461cc9b9-2397-0dba-91e9-33af4c63f7ec
59+
toBase58 9f9nftX6dw4oVPm5uT17um
60+
toBase32 263K4VJ8WQ1PX93T9KNX667XZC
61+
----------------------- --------------------------------------
6262
6363
6464
EOF
6565
, $commandTester->getDisplay(true));
6666

6767
$this->assertSame(0, $commandTester->execute(['uuid' => '461cc9b9-2397-2dba-91e9-33af4c63f7ec']));
6868
$this->assertSame(<<<EOF
69-
---------------------- --------------------------------------
70-
Label Value
71-
---------------------- --------------------------------------
72-
Version unknown
73-
Canonical (RFC 4122) 461cc9b9-2397-2dba-91e9-33af4c63f7ec
74-
Base 58 9f9nftX6fjLfNnvSAHMV7Z
75-
Base 32 263K4VJ8WQ5PX93T9KNX667XZC
76-
---------------------- --------------------------------------
69+
----------------------- --------------------------------------
70+
Label Value
71+
----------------------- --------------------------------------
72+
Version unknown
73+
toRfc4122 (canonical) 461cc9b9-2397-2dba-91e9-33af4c63f7ec
74+
toBase58 9f9nftX6fjLfNnvSAHMV7Z
75+
toBase32 263K4VJ8WQ5PX93T9KNX667XZC
76+
----------------------- --------------------------------------
7777
7878
7979
EOF
8080
, $commandTester->getDisplay(true));
8181

8282
$this->assertSame(0, $commandTester->execute(['uuid' => '461cc9b9-2397-7dba-91e9-33af4c63f7ec']));
8383
$this->assertSame(<<<EOF
84-
---------------------- --------------------------------------
85-
Label Value
86-
---------------------- --------------------------------------
87-
Version unknown
88-
Canonical (RFC 4122) 461cc9b9-2397-7dba-91e9-33af4c63f7ec
89-
Base 58 9f9nftX6kE2K6HpooNEQ83
90-
Base 32 263K4VJ8WQFPX93T9KNX667XZC
91-
---------------------- --------------------------------------
84+
----------------------- --------------------------------------
85+
Label Value
86+
----------------------- --------------------------------------
87+
Version unknown
88+
toRfc4122 (canonical) 461cc9b9-2397-7dba-91e9-33af4c63f7ec
89+
toBase58 9f9nftX6kE2K6HpooNEQ83
90+
toBase32 263K4VJ8WQFPX93T9KNX667XZC
91+
----------------------- --------------------------------------
9292
9393
9494
EOF
9595
, $commandTester->getDisplay(true));
9696

9797
$this->assertSame(0, $commandTester->execute(['uuid' => '461cc9b9-2397-cdba-91e9-33af4c63f7ec']));
9898
$this->assertSame(<<<EOF
99-
---------------------- --------------------------------------
100-
Label Value
101-
---------------------- --------------------------------------
102-
Version unknown
103-
Canonical (RFC 4122) 461cc9b9-2397-cdba-91e9-33af4c63f7ec
104-
Base 58 9f9nftX6pihxonjBST7K8X
105-
Base 32 263K4VJ8WQSPX93T9KNX667XZC
106-
---------------------- --------------------------------------
99+
----------------------- --------------------------------------
100+
Label Value
101+
----------------------- --------------------------------------
102+
Version unknown
103+
toRfc4122 (canonical) 461cc9b9-2397-cdba-91e9-33af4c63f7ec
104+
toBase58 9f9nftX6pihxonjBST7K8X
105+
toBase32 263K4VJ8WQSPX93T9KNX667XZC
106+
----------------------- --------------------------------------
107107
108108
109109
EOF
@@ -116,16 +116,16 @@ public function testV1()
116116

117117
$this->assertSame(0, $commandTester->execute(['uuid' => '4c8e3a2a-5993-11eb-a861-2bf05af69e52']));
118118
$this->assertSame(<<<EOF
119-
---------------------- --------------------------------------
120-
Label Value
121-
---------------------- --------------------------------------
122-
Version 1
123-
Canonical (RFC 4122) 4c8e3a2a-5993-11eb-a861-2bf05af69e52
124-
Base 58 ATJGVdrgFqvc6thDFXv1Qu
125-
Base 32 2CHRX2MPCK27NTGR9BY1DFD7JJ
126-
---------------------- --------------------------------------
127-
Timestamp 2021-01-18 13:44:34.438609
128-
---------------------- --------------------------------------
119+
----------------------- --------------------------------------
120+
Label Value
121+
----------------------- --------------------------------------
122+
Version 1
123+
toRfc4122 (canonical) 4c8e3a2a-5993-11eb-a861-2bf05af69e52
124+
toBase58 ATJGVdrgFqvc6thDFXv1Qu
125+
toBase32 2CHRX2MPCK27NTGR9BY1DFD7JJ
126+
----------------------- --------------------------------------
127+
Time 2021-01-18 13:44:34.438609 UTC
128+
----------------------- --------------------------------------
129129
130130
131131
EOF
@@ -138,14 +138,14 @@ public function testV3()
138138

139139
$this->assertSame(0, $commandTester->execute(['uuid' => 'd108a1a0-957e-3c77-b110-d3f912374439']));
140140
$this->assertSame(<<<EOF
141-
---------------------- --------------------------------------
142-
Label Value
143-
---------------------- --------------------------------------
144-
Version 3
145-
Canonical (RFC 4122) d108a1a0-957e-3c77-b110-d3f912374439
146-
Base 58 Sp7q16VVeC7zPsMPVEToq2
147-
Base 32 6H12GT15BY7HVV246KZ493EH1S
148-
---------------------- --------------------------------------
141+
----------------------- --------------------------------------
142+
Label Value
143+
----------------------- --------------------------------------
144+
Version 3
145+
toRfc4122 (canonical) d108a1a0-957e-3c77-b110-d3f912374439
146+
toBase58 Sp7q16VVeC7zPsMPVEToq2
147+
toBase32 6H12GT15BY7HVV246KZ493EH1S
148+
----------------------- --------------------------------------
149149
150150
151151
EOF
@@ -158,14 +158,14 @@ public function testV4()
158158

159159
$this->assertSame(0, $commandTester->execute(['uuid' => '705c6eab-a535-4f49-bd51-436d0e81206a']));
160160
$this->assertSame(<<<EOF
161-
---------------------- --------------------------------------
162-
Label Value
163-
---------------------- --------------------------------------
164-
Version 4
165-
Canonical (RFC 4122) 705c6eab-a535-4f49-bd51-436d0e81206a
166-
Base 58 EsjuVs1nd42xt7jSB8hNQH
167-
Base 32 3GBHQAQ99N9X4VTMA3DM78283A
168-
---------------------- --------------------------------------
161+
----------------------- --------------------------------------
162+
Label Value
163+
----------------------- --------------------------------------
164+
Version 4
165+
toRfc4122 (canonical) 705c6eab-a535-4f49-bd51-436d0e81206a
166+
toBase58 EsjuVs1nd42xt7jSB8hNQH
167+
toBase32 3GBHQAQ99N9X4VTMA3DM78283A
168+
----------------------- --------------------------------------
169169
170170
171171
EOF
@@ -178,14 +178,14 @@ public function testV5()
178178

179179
$this->assertSame(0, $commandTester->execute(['uuid' => '4ec6c3ad-de94-5f75-b5f0-ad56661a30c4']));
180180
$this->assertSame(<<<EOF
181-
---------------------- --------------------------------------
182-
Label Value
183-
---------------------- --------------------------------------
184-
Version 5
185-
Canonical (RFC 4122) 4ec6c3ad-de94-5f75-b5f0-ad56661a30c4
186-
Bas 57AE e 58 AjCoyQeK6TtFemqYWV5uKZ
187-
Base 32 2ERV1TVQMMBXTVBW5DASK1MC64
188-
---------------------- --------------------------------------
181+
----------------------- --------------------------------------
182+
Label Value
183+
----------------------- --------------------------------------
184+
Version 5
185+
toRfc4122 (canonical) 4ec6c3ad-de94-5f75-b5f0-ad56661a30c4
186+
toBase58 AjCoyQeK6TtFemqYWV5uKZ
187+
toBase32 2ERV1TVQMMBXTVBW5DASK1MC64
188+
----------------------- --------------------------------------
189189
190190
191191
EOF
@@ -198,16 +198,16 @@ public function testV6()
198198

199199
$this->assertSame(0, $commandTester->execute(['uuid' => '1eb59937-b0a7-6288-a861-db3dc2d8d4db']));
200200
$this->assertSame(<<<EOF
201-
---------------------- --------------------------------------
202-
Label Value
203-
---------------------- --------------------------------------
204-
Version 6
205-
Canonical (RFC 4122) 1eb59937-b0a7-6288-a861-db3dc2d8d4db
206-
Base 58 4nwhs6vwvNU2AbcCSD1XP8
207-
Base 32 0YPPCKFC57CA4AGREV7Q1DHN6V
208-
---------------------- --------------------------------------
209-
Timestamp 2021-01-18 13:45:52.427892
210-
---------------------- --------------------------------------
201+
----------------------- --------------------------------------
202+
Label Value
203+
----------------------- --------------------------------------
204+
Version 6
205+
toRfc4122 (canonical) 1eb59937-b0a7-6288-a861-db3dc2d8d4db
206+
toBase58 4nwhs6vwvNU2AbcCSD1XP8
207+
toBase32 0YPPCKFC57CA4AGREV7Q1DHN6V
208+
----------------------- --------------------------------------
209+
Time 2021-01-18 13:45:52.427892 UTC
210+
----------------------- --------------------------------------
211211
212212
213213
EOF

0 commit comments

Comments
 (0)
0