From b16aead14b4d2b9a46a0bb31559f1da4e88b33d3 Mon Sep 17 00:00:00 2001 From: zipofar Date: Fri, 16 Mar 2018 18:56:34 +0300 Subject: [PATCH 1/2] If user enter zero, then cycle never stop with empty() check --- lib/cli/Streams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/Streams.php b/lib/cli/Streams.php index 1dbfcd6..967e1c3 100755 --- a/lib/cli/Streams.php +++ b/lib/cli/Streams.php @@ -165,7 +165,7 @@ public static function prompt( $question, $default = null, $marker = ': ', $hide self::out( $question . $marker ); $line = self::input( null, $hide ); - if( !empty( $line ) ) + if ( trim($line) !== "" ) return $line; if( $default !== false ) return $default; From 390fe3f4477a482906b0ac375ce74158db42201e Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 10 Apr 2018 20:56:21 +0200 Subject: [PATCH 2/2] Fix CS --- lib/cli/Streams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/Streams.php b/lib/cli/Streams.php index 967e1c3..85e2929 100755 --- a/lib/cli/Streams.php +++ b/lib/cli/Streams.php @@ -165,7 +165,7 @@ public static function prompt( $question, $default = null, $marker = ': ', $hide self::out( $question . $marker ); $line = self::input( null, $hide ); - if ( trim($line) !== "" ) + if ( trim( $line ) !== '' ) return $line; if( $default !== false ) return $default;