Skip to content

Commit 52d63a0

Browse files
committed
addd accesser keyword for all constants
1 parent 1dfde30 commit 52d63a0

File tree

13 files changed

+156
-154
lines changed

13 files changed

+156
-154
lines changed

examples/demo/cli-spinner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public static function prompt($prompt, $masked=false, $limit=100)
8888
Status::hide(false);
8989
echo $input;
9090
die;
91+
9192
$total = random_int(5000, 10000);
9293
for ($x=1; $x<=$total; $x++) {
9394
Status::spinner();
@@ -102,4 +103,4 @@ public static function prompt($prompt, $masked=false, $limit=100)
102103
// echo "Yay! You got it!";
103104
// } else {
104105
// echo "Boo! That is wrong!";
105-
// }
106+
// }

src/BuiltIn/SelfUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
*/
2323
class SelfUpdateCommand extends Command
2424
{
25-
const VERSION_URL = 'https://padraic.github.io/humbug/downloads/humbug.version';
25+
public const VERSION_URL = 'https://padraic.github.io/humbug/downloads/humbug.version';
2626

27-
const PHAR_URL = 'https://padraic.github.io/humbug/downloads/humbug.phar';
27+
public const PHAR_URL = 'https://padraic.github.io/humbug/downloads/humbug.phar';
2828

29-
const PACKAGE_NAME = 'humbug/humbug';
29+
public const PACKAGE_NAME = 'humbug/humbug';
3030

31-
const FILE_NAME = 'humbug.phar';
31+
public const FILE_NAME = 'humbug.phar';
3232

3333
protected static $name = 'self-update';
3434
protected static $description = 'Update phar package to most recent stable, pre-release or development build.';

src/Component/Formatter/Formatter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
abstract class Formatter
1616
{
1717
// content align
18-
const ALIGN_LEFT = 'left';
19-
const ALIGN_CENTER = 'center';
20-
const ALIGN_RIGHT = 'right';
18+
public const ALIGN_LEFT = 'left';
19+
public const ALIGN_CENTER = 'center';
20+
public const ALIGN_RIGHT = 'right';
2121

2222
/**
2323
* @var array

src/Component/PharCompiler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ private function stripWhitespace(string $source): string
660660
/**
661661
* auto collect project information by git log
662662
* @throws \RuntimeException
663+
* @throws \Exception
663664
*/
664665
private function collectInformation()
665666
{

src/Component/Style/Alert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class Alert
1616
{
17-
const THEMES = [
17+
public const THEMES = [
1818
'default' => '<{@style}>{@message}</{@style}>',
1919
'theme1' => '<{@style}>[{@type}] {@message}</{@style}>',
2020
'lite' => '[<{@style}>{@type}</{@style}>] {@message}',

src/Component/Style/Color.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@
1414
final class Color
1515
{
1616
/** Foreground base value */
17-
const FG_BASE = 30;
17+
public const FG_BASE = 30;
1818

1919
/** Background base value */
20-
const BG_BASE = 40;
20+
public const BG_BASE = 40;
2121

2222
/** Extra Foreground base value */
23-
const FG_EXTRA = 90;
23+
public const FG_EXTRA = 90;
2424

2525
/** Extra Background base value */
26-
const BG_EXTRA = 100;
26+
public const BG_EXTRA = 100;
2727

2828
// color
29-
const BLACK = 'black';
30-
const RED = 'red';
31-
const GREEN = 'green';
32-
const YELLOW = 'yellow'; // BROWN
33-
const BLUE = 'blue';
34-
const MAGENTA = 'magenta';
35-
const CYAN = 'cyan';
36-
const WHITE = 'white';
37-
const NORMAL = 'normal';
29+
public const BLACK = 'black';
30+
public const RED = 'red';
31+
public const GREEN = 'green';
32+
public const YELLOW = 'yellow'; // BROWN
33+
public const BLUE = 'blue';
34+
public const MAGENTA = 'magenta';
35+
public const CYAN = 'cyan';
36+
public const WHITE = 'white';
37+
public const NORMAL = 'normal';
3838

3939
// color option
40-
const BOLD = 'bold'; // 加粗
41-
const FUZZY = 'fuzzy'; // 模糊(不是所有的终端仿真器都支持)
42-
const ITALIC = 'italic'; // 斜体(不是所有的终端仿真器都支持)
43-
const UNDERSCORE = 'underscore'; // 下划线
44-
const BLINK = 'blink'; // 闪烁
45-
const REVERSE = 'reverse'; // 颠倒的 交换背景色与前景色
46-
const CONCEALED = 'concealed'; // 隐匿的
40+
public const BOLD = 'bold'; // 加粗
41+
public const FUZZY = 'fuzzy'; // 模糊(不是所有的终端仿真器都支持)
42+
public const ITALIC = 'italic'; // 斜体(不是所有的终端仿真器都支持)
43+
public const UNDERSCORE = 'underscore'; // 下划线
44+
public const BLINK = 'blink'; // 闪烁
45+
public const REVERSE = 'reverse'; // 颠倒的 交换背景色与前景色
46+
public const CONCEALED = 'concealed'; // 隐匿的
4747

4848
/** @var array Known color list */
4949
private static $knownColors = array(

src/Component/Style/Style.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,30 @@ class Style
3030
/**
3131
* there are some default style tags
3232
*/
33-
const NORMAL = 'normal';
34-
const FAINTLY = 'faintly';
35-
const BOLD = 'bold';
36-
const NOTICE = 'notice';
37-
const PRIMARY = 'primary';
38-
const SUCCESS = 'success';
39-
const INFO = 'info';
40-
const NOTE = 'note';
41-
const WARNING = 'warning';
42-
const COMMENT = 'comment';
43-
const QUESTION = 'question';
44-
const DANGER = 'danger';
45-
const ERROR = 'error';
33+
public const NORMAL = 'normal';
34+
public const FAINTLY = 'faintly';
35+
public const BOLD = 'bold';
36+
public const NOTICE = 'notice';
37+
public const PRIMARY = 'primary';
38+
public const SUCCESS = 'success';
39+
public const INFO = 'info';
40+
public const NOTE = 'note';
41+
public const WARNING = 'warning';
42+
public const COMMENT = 'comment';
43+
public const QUESTION = 'question';
44+
public const DANGER = 'danger';
45+
public const ERROR = 'error';
4646

4747
/**
4848
* Regex to match tags
4949
* @var string
5050
*/
51-
const COLOR_TAG = '/<([a-zA-Z=;]+)>(.*?)<\/\\1>/s';
51+
public const COLOR_TAG = '/<([a-zA-Z=;]+)>(.*?)<\/\\1>/s';
5252

5353
/**
5454
* Regex used for removing color codes
5555
*/
56-
const STRIP_TAG = '/<[\/]?[a-zA-Z=;]+>/';
56+
public const STRIP_TAG = '/<[\/]?[a-zA-Z=;]+>/';
5757

5858
/**
5959
* @var self

src/Component/Symbol/ArtFont.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818
class ArtFont
1919
{
20-
const DEFAULT_GROUP = '_default';
21-
const INTERNAL_GROUP = '_internal';
20+
public const DEFAULT_GROUP = '_default';
21+
public const INTERNAL_GROUP = '_internal';
2222

2323
/** @var self */
2424
private static $instance;

src/Component/Symbol/Char.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,29 @@
1515
*/
1616
final class Char
1717
{
18-
const OK = '';
19-
const NO = '';
20-
const PEN = '';
18+
public const OK = '';
19+
public const NO = '';
20+
public const PEN = '';
2121

22-
const HEART = '';
23-
const SMILE = '';
22+
public const HEART = '';
23+
public const SMILE = '';
2424

25-
const FLOWER = '';
26-
const MUSIC = '';
25+
public const FLOWER = '';
26+
public const MUSIC = '';
2727

28-
const UP = '';
29-
const DOWN = '';
30-
const LEFT = '';
31-
const RIGHT = '';
32-
const SEARCH = '';
28+
public const UP = '';
29+
public const DOWN = '';
30+
public const LEFT = '';
31+
public const RIGHT = '';
32+
public const SEARCH = '';
3333

34-
const MALE = '';
35-
const FEMALE = '';
34+
public const MALE = '';
35+
public const FEMALE = '';
3636

37-
const SUN = '';
38-
const STAR = '';
39-
const SNOW = '';
40-
const CLOUD = '';
37+
public const SUN = '';
38+
public const STAR = '';
39+
public const SNOW = '';
40+
public const CLOUD = '';
4141

4242
/**
4343
* @var array

src/Component/Symbol/Emoji.php

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,71 @@
1414
*/
1515
final class Emoji
1616
{
17-
const ID = '🆔';
18-
const KEY = '🔑';
19-
const BOX = '📦';
20-
const GIFT = '🎁';
21-
const CLOCK = '';
22-
const FLAG = '🚩';
23-
const TOOL = '🔧';
24-
const GUN = '🔫';
25-
const DING = '📌';
26-
const STOP = '🚫';
27-
28-
const DOC = '📄';
29-
const DIR = '📂';
30-
const BOOK = '📔';
31-
const RECYCLE = '';
32-
33-
const EDIT = '';
34-
const SMILE = '😊';
35-
const LAUGH = '😆';
36-
const LIKE = '😍';
37-
const ANGER = '😡';
38-
const HAPPY = '😀';
39-
const DOZE = '😴';
40-
41-
const OK = '👌';
42-
const YES = '';
43-
const NO = '';
44-
const PRAISE = '👍';
45-
const TREAD = '👎';
46-
const STEP = '🐾';
47-
48-
const UP = '👆';
49-
const DOWN = '👇';
50-
const LEFT = '👈';
51-
const RIGHT = '👉';
52-
53-
const FIRE = '🔥';
54-
const SNOW = '';
55-
const WATER = '💧';
56-
const FLASH = '';
57-
58-
const EYE = '👀';
59-
const HEART = '💖';
60-
const HEARTBREAK = '💔';
61-
62-
const SUC = '';
63-
const FAIL = '';
64-
const WAN = '';
65-
const QUESTION = '';
66-
67-
const CAR = '🚕';
68-
69-
const TREE = '🌲';
70-
const FLOWER = '🌺';
71-
72-
const PEAR = '🍐';
73-
const APPLE = '🍎';
74-
75-
const ELEPHANT = '🐘';
76-
const WHALE = '🐳';
77-
78-
const SUN = '🌞';
79-
const STAR = '';
80-
const MOON = '🌜';
81-
const EARTH = '🌏';
17+
public const ID = '🆔';
18+
public const KEY = '🔑';
19+
public const BOX = '📦';
20+
public const GIFT = '🎁';
21+
public const CLOCK = '';
22+
public const FLAG = '🚩';
23+
public const TOOL = '🔧';
24+
public const GUN = '🔫';
25+
public const DING = '📌';
26+
public const STOP = '🚫';
27+
28+
public const DOC = '📄';
29+
public const DIR = '📂';
30+
public const BOOK = '📔';
31+
public const RECYCLE = '';
32+
33+
public const EDIT = '';
34+
public const SMILE = '😊';
35+
public const LAUGH = '😆';
36+
public const LIKE = '😍';
37+
public const ANGER = '😡';
38+
public const HAPPY = '😀';
39+
public const DOZE = '😴';
40+
41+
public const OK = '👌';
42+
public const YES = '';
43+
public const NO = '';
44+
public const PRAISE = '👍';
45+
public const TREAD = '👎';
46+
public const STEP = '🐾';
47+
48+
public const UP = '👆';
49+
public const DOWN = '👇';
50+
public const LEFT = '👈';
51+
public const RIGHT = '👉';
52+
53+
public const FIRE = '🔥';
54+
public const SNOW = '';
55+
public const WATER = '💧';
56+
public const FLASH = '';
57+
58+
public const EYE = '👀';
59+
public const HEART = '💖';
60+
public const HEARTBREAK = '💔';
61+
62+
public const SUC = '';
63+
public const FAIL = '';
64+
public const WAN = '';
65+
public const QUESTION = '';
66+
67+
public const CAR = '🚕';
68+
69+
public const TREE = '🌲';
70+
public const FLOWER = '🌺';
71+
72+
public const PEAR = '🍐';
73+
public const APPLE = '🍎';
74+
75+
public const ELEPHANT = '🐘';
76+
public const WHALE = '🐳';
77+
78+
public const SUN = '🌞';
79+
public const STAR = '';
80+
public const MOON = '🌜';
81+
public const EARTH = '🌏';
8282

8383
/**
8484
* @var array

0 commit comments

Comments
 (0)