2424use Toolkit \Cli \Style ;
2525use function method_exists ;
2626use function sprintf ;
27- use function strpos ;
2827use function substr ;
2928
3029/**
@@ -85,11 +84,11 @@ public function colored(string $text, string $tag = 'info'): int
8584 * @param array|mixed $messages
8685 * @param string $type
8786 * @param string $style
88- * @param bool $quit
87+ * @param bool $quit
8988 *
9089 * @return int
9190 */
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
9392 {
9493 return Show::block ($ messages , $ type , $ style , $ quit );
9594 }
@@ -98,11 +97,11 @@ public function block($messages, string $type = 'MESSAGE', string $style = Style
9897 * @param array|mixed $messages
9998 * @param string $type
10099 * @param string $style
101- * @param bool $quit
100+ * @param bool $quit
102101 *
103102 * @return int
104103 */
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
106105 {
107106 return Show::liteBlock ($ messages , $ type , $ style , $ quit );
108107 }
@@ -118,10 +117,10 @@ public function title(string $title, array $opts = []): void
118117
119118 /**
120119 * @param string $title
121- * @param string| array $body The section body message
120+ * @param array|string $body The section body message
122121 * @param array $opts
123122 */
124- public function section (string $ title , $ body , array $ opts = []): void
123+ public function section (string $ title , array | string $ body , array $ opts = []): void
125124 {
126125 Section::show ($ title , $ body , $ opts );
127126 }
@@ -131,7 +130,7 @@ public function section(string $title, $body, array $opts = []): void
131130 * @param string $title
132131 * @param array $opts
133132 */
134- public function aList ($ data , string $ title = 'Information ' , array $ opts = []): void
133+ public function aList (mixed $ data , string $ title = 'Information ' , array $ opts = []): void
135134 {
136135 SingleList::show ($ data , $ title , $ opts );
137136 }
@@ -201,7 +200,7 @@ public function progressTxt(int $total, string $msg, string $doneMsg = ''): Gene
201200 * @return Generator
202201 * @see Show::progressBar()
203202 */
204- public function progressBar ($ total , array $ opts = []): Generator
203+ public function progressBar (int $ total , array $ opts = []): Generator
205204 {
206205 return Show::progressBar ($ total , $ opts );
207206 }
@@ -222,7 +221,7 @@ public function __call(string $method, array $args = [])
222221 $ quit = $ args [1 ] ?? false ;
223222 $ style = $ map [$ method ];
224223
225- if (0 === strpos ($ method , 'lite ' )) {
224+ if (str_starts_with ($ method , 'lite ' )) {
226225 $ type = substr ($ method , 4 );
227226 return Show::liteBlock ($ msg , $ type === 'Primary ' ? 'IMPORTANT ' : $ type , $ style , $ quit );
228227 }
0 commit comments