@@ -204,13 +204,13 @@ public static function input(string $prefix = null): string
204204 * $email = CLI::prompt('What is your email?', null, 'required|valid_email');
205205 *
206206 * @param string $field Output "field" question
207- * @param string|array $options String to a defaul value, array to a list of options (the first option will be the default value)
207+ * @param string|array $options String to a default value, array to a list of options (the first option will be the default value)
208208 * @param string $validation Validation rules
209209 *
210210 * @return string The user input
211211 * @codeCoverageIgnore
212212 */
213- public static function prompt ($ field , $ options = null , $ validation = null ): string
213+ public static function prompt (string $ field , $ options = null , string $ validation = null ): string
214214 {
215215 $ extra_output = '' ;
216216 $ default = '' ;
@@ -270,7 +270,7 @@ public static function prompt($field, $options = null, $validation = null): stri
270270 * @return boolean
271271 * @codeCoverageIgnore
272272 */
273- protected static function validate ($ field , $ value , $ rules )
273+ protected static function validate (string $ field , string $ value , string $ rules ): bool
274274 {
275275 $ validation = \Config \Services::validation (null , false );
276276 $ validation ->setRule ($ field , null , $ rules );
@@ -380,10 +380,12 @@ public static function wait(int $seconds, bool $countdown = false)
380380
381381 /**
382382 * if operating system === windows
383+ *
384+ * @return boolean
383385 */
384- public static function isWindows ()
386+ public static function isWindows (): bool
385387 {
386- return stripos (PHP_OS , 'WIN ' ) === 0 ;
388+ return stripos (PHP_OS , 'WIN ' ) === 0 ;
387389 }
388390
389391 //--------------------------------------------------------------------
@@ -436,7 +438,7 @@ public static function clearScreen()
436438 *
437439 * @return string The color coded string
438440 */
439- public static function color (string $ text , string $ foreground , string $ background = null , string $ format = null )
441+ public static function color (string $ text , string $ foreground , string $ background = null , string $ format = null ): string
440442 {
441443 if (static ::isWindows () && ! isset ($ _SERVER ['ANSICON ' ]))
442444 {
@@ -655,7 +657,7 @@ public static function wrap(string $string = null, int $max = 0, int $pad_left =
655657 * Parses the command line it was called from and collects all
656658 * options and valid segments.
657659 *
658- * I tried to use getopt but had it fail occassionally to find any
660+ * I tried to use getopt but had it fail occasionally to find any
659661 * options but argc has always had our back. We don't have all of the power
660662 * of getopt but this does us just fine.
661663 */
@@ -706,7 +708,7 @@ protected static function parseCommandLine()
706708 *
707709 * @return string
708710 */
709- public static function getURI ()
711+ public static function getURI (): string
710712 {
711713 return implode ('/ ' , static ::$ segments );
712714 }
@@ -743,7 +745,7 @@ public static function getSegment(int $index)
743745 *
744746 * @return array
745747 */
746- public static function getSegments ()
748+ public static function getSegments (): array
747749 {
748750 return static ::$ segments ;
749751 }
@@ -779,7 +781,7 @@ public static function getOption(string $name)
779781 *
780782 * @return array
781783 */
782- public static function getOptions ()
784+ public static function getOptions (): array
783785 {
784786 return static ::$ options ;
785787 }
@@ -819,12 +821,12 @@ public static function getOptionString(): string
819821 //--------------------------------------------------------------------
820822
821823 /**
822- * Returns a well formated table
824+ * Returns a well formatted table
823825 *
824826 * @param array $tbody List of rows
825827 * @param array $thead List of columns
826828 *
827- * @return string
829+ * @return void
828830 */
829831 public static function table (array $ tbody , array $ thead = [])
830832 {
0 commit comments