@@ -646,21 +646,12 @@ public static function writef(string $format, ...$args): int
646646 *
647647 * @param array|string $messages Output message
648648 * @param boolean $nl True 会添加换行符, False 原样输出,不添加换行符
649- * @param bool|int $quit If is int, setting it is exit code. 'True' translate as code 0 and exit, 'False' will not exit.
649+ * @param bool $quit If is int, setting it is exit code. 'True' translate as code 0 and exit, 'False' will not exit.
650650 * @param array{color:bool,stream:resource,flush:bool,quit:bool,quitCode:int} $opts Some options for write
651- * refer:
652- * [
653- * 'color' => bool, // whether render color, default is: True.
654- * 'stream' => resource, // the stream resource, default is: STDOUT
655- * 'flush' => bool, // flush the stream data, default is: True
656- * ]
657- *
658651 * @return int
659652 */
660653 public static function write (array |string $ messages , bool $ nl = true , bool $ quit = false , array $ opts = []): int
661654 {
662- $ qCode = $ opts ['quitCode ' ] ?? 0 ;
663-
664655 return Console::write ($ messages , $ nl , $ quit , $ opts );
665656 }
666657
@@ -704,7 +695,7 @@ public static function writeln(array|string $message, bool $quit = false, array
704695 */
705696 public static function colored (array |string $ message , string $ style = 'info ' , bool $ nl = true , array $ opts = []): int
706697 {
707- $ quit = isset ($ opts ['quit ' ]) ? ( bool ) $ opts ['quit ' ] : false ;
698+ $ quit = isset ($ opts ['quit ' ]) && $ opts ['quit ' ];
708699
709700 if (is_array ($ message )) {
710701 $ message = implode ($ nl ? PHP_EOL : '' , $ message );
0 commit comments