24
24
use Toolkit \Cli \Style ;
25
25
use function method_exists ;
26
26
use function sprintf ;
27
- use function strpos ;
28
27
use function substr ;
29
28
30
29
/**
@@ -85,11 +84,11 @@ public function colored(string $text, string $tag = 'info'): int
85
84
* @param array|mixed $messages
86
85
* @param string $type
87
86
* @param string $style
88
- * @param bool $quit
87
+ * @param bool $quit
89
88
*
90
89
* @return int
91
90
*/
92
- public function block ($ messages , string $ type = 'MESSAGE ' , string $ style = Style::NORMAL , $ quit = false ): int
91
+ public function block (mixed $ messages , string $ type = 'MESSAGE ' , string $ style = Style::NORMAL , bool $ quit = false ): int
93
92
{
94
93
return Show::block ($ messages , $ type , $ style , $ quit );
95
94
}
@@ -98,11 +97,11 @@ public function block($messages, string $type = 'MESSAGE', string $style = Style
98
97
* @param array|mixed $messages
99
98
* @param string $type
100
99
* @param string $style
101
- * @param bool $quit
100
+ * @param bool $quit
102
101
*
103
102
* @return int
104
103
*/
105
- public function liteBlock ($ messages , string $ type = 'MESSAGE ' , string $ style = Style::NORMAL , $ quit = false ): int
104
+ public function liteBlock (mixed $ messages , string $ type = 'MESSAGE ' , string $ style = Style::NORMAL , bool $ quit = false ): int
106
105
{
107
106
return Show::liteBlock ($ messages , $ type , $ style , $ quit );
108
107
}
@@ -118,10 +117,10 @@ public function title(string $title, array $opts = []): void
118
117
119
118
/**
120
119
* @param string $title
121
- * @param string| array $body The section body message
120
+ * @param array|string $body The section body message
122
121
* @param array $opts
123
122
*/
124
- public function section (string $ title , $ body , array $ opts = []): void
123
+ public function section (string $ title , array | string $ body , array $ opts = []): void
125
124
{
126
125
Section::show ($ title , $ body , $ opts );
127
126
}
@@ -131,7 +130,7 @@ public function section(string $title, $body, array $opts = []): void
131
130
* @param string $title
132
131
* @param array $opts
133
132
*/
134
- public function aList ($ data , string $ title = 'Information ' , array $ opts = []): void
133
+ public function aList (mixed $ data , string $ title = 'Information ' , array $ opts = []): void
135
134
{
136
135
SingleList::show ($ data , $ title , $ opts );
137
136
}
@@ -201,7 +200,7 @@ public function progressTxt(int $total, string $msg, string $doneMsg = ''): Gene
201
200
* @return Generator
202
201
* @see Show::progressBar()
203
202
*/
204
- public function progressBar ($ total , array $ opts = []): Generator
203
+ public function progressBar (int $ total , array $ opts = []): Generator
205
204
{
206
205
return Show::progressBar ($ total , $ opts );
207
206
}
@@ -222,7 +221,7 @@ public function __call(string $method, array $args = [])
222
221
$ quit = $ args [1 ] ?? false ;
223
222
$ style = $ map [$ method ];
224
223
225
- if (0 === strpos ($ method , 'lite ' )) {
224
+ if (str_starts_with ($ method , 'lite ' )) {
226
225
$ type = substr ($ method , 4 );
227
226
return Show::liteBlock ($ msg , $ type === 'Primary ' ? 'IMPORTANT ' : $ type , $ style , $ quit );
228
227
}
0 commit comments