Skip to content

Commit d31d68e

Browse files
committed
[UUID] Fixed CS
1 parent 4d0b530 commit d31d68e

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/Uuid/Uuid.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Uuid
3535
public static function uuid_create($uuid_type = UUID_TYPE_DEFAULT)
3636
{
3737
if (!\is_int($uuid_type)) {
38-
trigger_error(sprintf('uuid_create() expects parameter 1 to be int, %s given', gettype($uuid_type)), E_USER_WARNING);
38+
trigger_error(sprintf('uuid_create() expects parameter 1 to be int, %s given', \gettype($uuid_type)), E_USER_WARNING);
3939

4040
return null;
4141
}
@@ -58,13 +58,13 @@ public static function uuid_create($uuid_type = UUID_TYPE_DEFAULT)
5858
public static function uuid_generate_md5($uuid_ns, $name)
5959
{
6060
if (!\is_string($uuid_ns)) {
61-
trigger_error(sprintf('uuid_generate_md5() expects parameter 1 to be string, %s given', gettype($uuid_ns)), E_USER_WARNING);
61+
trigger_error(sprintf('uuid_generate_md5() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), E_USER_WARNING);
6262

6363
return null;
6464
}
6565

6666
if (!\is_string($name)) {
67-
trigger_error(sprintf('uuid_generate_md5() expects parameter 2 to be string, %s given', gettype($name)), E_USER_WARNING);
67+
trigger_error(sprintf('uuid_generate_md5() expects parameter 2 to be string, %s given', \gettype($name)), E_USER_WARNING);
6868

6969
return null;
7070
}
@@ -98,13 +98,13 @@ public static function uuid_generate_md5($uuid_ns, $name)
9898
public static function uuid_generate_sha1($uuid_ns, $name)
9999
{
100100
if (!\is_string($uuid_ns)) {
101-
trigger_error(sprintf('uuid_generate_sha1() expects parameter 1 to be string, %s given', gettype($uuid_ns)), E_USER_WARNING);
101+
trigger_error(sprintf('uuid_generate_sha1() expects parameter 1 to be string, %s given', \gettype($uuid_ns)), E_USER_WARNING);
102102

103103
return null;
104104
}
105105

106106
if (!\is_string($name)) {
107-
trigger_error(sprintf('uuid_generate_sha1() expects parameter 2 to be string, %s given', gettype($name)), E_USER_WARNING);
107+
trigger_error(sprintf('uuid_generate_sha1() expects parameter 2 to be string, %s given', \gettype($name)), E_USER_WARNING);
108108

109109
return null;
110110
}
@@ -140,7 +140,7 @@ public static function uuid_generate_sha1($uuid_ns, $name)
140140
public static function uuid_is_valid($uuid)
141141
{
142142
if (!\is_string($uuid)) {
143-
trigger_error(sprintf('uuid_is_valid() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
143+
trigger_error(sprintf('uuid_is_valid() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
144144

145145
return null;
146146
}
@@ -151,13 +151,13 @@ public static function uuid_is_valid($uuid)
151151
public static function uuid_compare($uuid1, $uuid2)
152152
{
153153
if (!\is_string($uuid1)) {
154-
trigger_error(sprintf('uuid_compare() expects parameter 1 to be string, %s given', gettype($uuid1)), E_USER_WARNING);
154+
trigger_error(sprintf('uuid_compare() expects parameter 1 to be string, %s given', \gettype($uuid1)), E_USER_WARNING);
155155

156156
return null;
157157
}
158158

159159
if (!\is_string($uuid2)) {
160-
trigger_error(sprintf('uuid_compare() expects parameter 2 to be string, %s given', gettype($uuid2)), E_USER_WARNING);
160+
trigger_error(sprintf('uuid_compare() expects parameter 2 to be string, %s given', \gettype($uuid2)), E_USER_WARNING);
161161

162162
return null;
163163
}
@@ -184,7 +184,7 @@ public static function uuid_compare($uuid1, $uuid2)
184184
public static function uuid_is_null($uuid)
185185
{
186186
if (!\is_string($uuid)) {
187-
trigger_error(sprintf('uuid_is_null() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
187+
trigger_error(sprintf('uuid_is_null() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
188188

189189
return null;
190190
}
@@ -195,7 +195,7 @@ public static function uuid_is_null($uuid)
195195
public static function uuid_type($uuid)
196196
{
197197
if (!\is_string($uuid)) {
198-
trigger_error(sprintf('uuid_type() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
198+
trigger_error(sprintf('uuid_type() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
199199

200200
return null;
201201
}
@@ -214,7 +214,7 @@ public static function uuid_type($uuid)
214214
public static function uuid_variant($uuid)
215215
{
216216
if (!\is_string($uuid)) {
217-
trigger_error(sprintf('uuid_variant() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
217+
trigger_error(sprintf('uuid_variant() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
218218

219219
return null;
220220
}
@@ -243,7 +243,7 @@ public static function uuid_variant($uuid)
243243
public static function uuid_time($uuid)
244244
{
245245
if (!\is_string($uuid)) {
246-
trigger_error(sprintf('uuid_time() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
246+
trigger_error(sprintf('uuid_time() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
247247

248248
return null;
249249
}
@@ -270,7 +270,7 @@ public static function uuid_time($uuid)
270270
public static function uuid_mac($uuid)
271271
{
272272
if (!\is_string($uuid)) {
273-
trigger_error(sprintf('uuid_mac() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
273+
trigger_error(sprintf('uuid_mac() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
274274

275275
return null;
276276
}
@@ -289,7 +289,7 @@ public static function uuid_mac($uuid)
289289
public static function uuid_parse($uuid)
290290
{
291291
if (!\is_string($uuid)) {
292-
trigger_error(sprintf('uuid_parse() expects parameter 1 to be string, %s given', gettype($uuid)), E_USER_WARNING);
292+
trigger_error(sprintf('uuid_parse() expects parameter 1 to be string, %s given', \gettype($uuid)), E_USER_WARNING);
293293

294294
return null;
295295
}
@@ -306,7 +306,7 @@ public static function uuid_parse($uuid)
306306
public static function uuid_unparse($uuidAsBinary)
307307
{
308308
if (!\is_string($uuidAsBinary)) {
309-
trigger_error(sprintf('uuid_unparse() expects parameter 1 to be string, %s given', gettype($uuidAsBinary)), E_USER_WARNING);
309+
trigger_error(sprintf('uuid_unparse() expects parameter 1 to be string, %s given', \gettype($uuidAsBinary)), E_USER_WARNING);
310310

311311
return null;
312312
}
@@ -427,12 +427,12 @@ private static function uuid_parse_as_array($uuid)
427427
return null;
428428
}
429429

430-
return [
430+
return array(
431431
'time_low' => hexdec($matches['time_low']),
432432
'time_mid' => hexdec($matches['time_mid']),
433433
'time_hi_and_version' => hexdec($matches['time_hi_and_version']),
434434
'clock_seq' => hexdec($matches['clock_seq']),
435435
'node' => hexdec($matches['node']),
436-
];
436+
);
437437
}
438438
}

tests/Uuid/UuidTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public function testGenerateMd5()
3333
{
3434
$uuidNs = uuid_create();
3535

36-
$this->assertFalse(uuid_generate_md5("not a uuid", "foo"));
36+
$this->assertFalse(uuid_generate_md5('not a uuid', 'foo'));
3737

38-
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $a = uuid_generate_md5($uuidNs, "foo"));
39-
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $b = uuid_generate_md5($uuidNs, "bar"));
38+
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $a = uuid_generate_md5($uuidNs, 'foo'));
39+
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $b = uuid_generate_md5($uuidNs, 'bar'));
4040
$this->assertNotSame($a, $b);
4141
$this->assertSame(UUID_TYPE_MD5, uuid_type($a));
4242
$this->assertSame(UUID_TYPE_MD5, uuid_type($b));
@@ -48,10 +48,10 @@ public function testGenerateSha1()
4848
{
4949
$uuidNs = uuid_create();
5050

51-
$this->assertFalse(uuid_generate_sha1("not a uuid", "foo"));
51+
$this->assertFalse(uuid_generate_sha1('not a uuid', 'foo'));
5252

53-
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $a = uuid_generate_sha1($uuidNs, "foo"));
54-
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $b = uuid_generate_sha1($uuidNs, "bar"));
53+
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $a = uuid_generate_sha1($uuidNs, 'foo'));
54+
$this->assertRegExp('{^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$}', $b = uuid_generate_sha1($uuidNs, 'bar'));
5555
$this->assertNotSame($a, $b);
5656
$this->assertSame(UUID_TYPE_SHA1, uuid_type($a));
5757
$this->assertSame(UUID_TYPE_SHA1, uuid_type($b));

0 commit comments

Comments
 (0)