Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 87ed0ab

Browse files
committed
run code inspection check. fix some errors
1 parent 0efd5b1 commit 87ed0ab

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/HtmlHelper.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,10 @@ public static function unescap($data, $type = 0, $encoding = 'UTF-8')
118118
$data[$k] = self::unescap($data, $type, $encoding);
119119
}
120120

121+
} elseif (!$type) {//默认使用 htmlspecialchars_decode()
122+
$data = htmlspecialchars_decode($data, ENT_QUOTES);
121123
} else {
122-
if (!$type) {//默认使用 htmlspecialchars_decode()
123-
$data = htmlspecialchars_decode($data, ENT_QUOTES);
124-
} else {
125-
$data = html_entity_decode($data, ENT_QUOTES, $encoding);
126-
}
124+
$data = html_entity_decode($data, ENT_QUOTES, $encoding);
127125
}
128126

129127
return $data;

src/UUID.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,79 +28,80 @@
2828
*/
2929
class UUID
3030
{
31-
const MD5 = 3;
32-
const SHA1 = 5;
31+
public const MD5 = 3;
32+
public const SHA1 = 5;
3333

3434
/** @var int 00001111 Clears all bits of version byte with AND */
35-
const CLEAR_VER = 15;
35+
public const CLEAR_VER = 15;
3636

3737
/** @var int 00111111 Clears all relevant bits of variant byte with AND */
38-
const CLEAR_VAR = 63;
38+
public const CLEAR_VAR = 63;
3939

4040
/** @var int 11100000 Variant reserved for future use */
41-
const VAR_RES = 224;
41+
public const VAR_RES = 224;
4242

4343
/** @var int 11000000 Microsoft UUID variant */
44-
const VAR_MS = 192;
44+
public const VAR_MS = 192;
4545

4646
/** @var int 10000000 The RFC 4122 variant (this variant) */
47-
const VAR_RFC = 128;
47+
public const VAR_RFC = 128;
4848

4949
/** @var int 00000000 The NCS compatibility variant */
50-
const VAR_NCS = 0;
50+
public const VAR_NCS = 0;
5151

5252
/** @var int 00010000 */
53-
const VERSION_1 = 16;
53+
public const VERSION_1 = 16;
5454

5555
/** @var int 00110000 */
56-
const VERSION_3 = 48;
56+
public const VERSION_3 = 48;
5757

5858
/** @var int 01000000 */
59-
const VERSION_4 = 64;
59+
public const VERSION_4 = 64;
6060

6161
/**
6262
* 01010000
6363
* @var int
6464
*/
65-
const VERSION_5 = 80;
65+
public const VERSION_5 = 80;
6666

6767
/**
6868
* Time (in 100ns steps) between the start of the UTC and Unix epochs
6969
* @var int
7070
*/
71-
const INTERVAL = 0x01b21dd213814000;
71+
public const INTERVAL = 0x01b21dd213814000;
7272

7373
/**
7474
* @var string
7575
*/
76-
const NS_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
76+
public const NS_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
7777

7878
/**
7979
* @var string
8080
*/
81-
const NS_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
81+
public const NS_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
8282

8383
/**
8484
* @var string
8585
*/
86-
const NS_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
86+
public const NS_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
8787

8888
/**
8989
* @var string
9090
*/
91-
const NS_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
91+
public const NS_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
9292

9393
/**
9494
* Regular expression for validation of UUID.
9595
*/
96-
const VALID_UUID_REGEX = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$';
96+
public const VALID_UUID_REGEX = '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$';
9797

9898
/**
9999
* @param int $ver
100100
* @param string|null $node
101101
* @param string|null $ns
102102
* @return UUID
103103
* @throws \InvalidArgumentException
104+
* @throws \Exception
104105
*/
105106
public static function gen(int $ver = 1, string $node = null, string $ns = null): self
106107
{
@@ -113,6 +114,7 @@ public static function gen(int $ver = 1, string $node = null, string $ns = null)
113114
* @param string $ns
114115
* @return UUID
115116
* @throws \InvalidArgumentException
117+
* @throws \Exception
116118
*/
117119
public static function generate(int $ver = 1, string $node = null, string $ns = null): self
118120
{

0 commit comments

Comments
 (0)