@@ -27,40 +27,40 @@ public function __construct( $prompt, $quiet = false ) {
2727 public function start () {
2828 // @phpstan-ignore while.alwaysTrue
2929 while ( true ) {
30- $ line = $ this ->prompt ();
30+ $ __repl_input_line = $ this ->prompt ();
3131
32- if ( '' === $ line ) {
32+ if ( '' === $ __repl_input_line ) {
3333 continue ;
3434 }
3535
36- $ line = rtrim ( $ line , '; ' ) . '; ' ;
36+ $ __repl_input_line = rtrim ( $ __repl_input_line , '; ' ) . '; ' ;
3737
38- if ( self ::starts_with ( self ::non_expressions (), $ line ) ) {
38+ if ( self ::starts_with ( self ::non_expressions (), $ __repl_input_line ) ) {
3939 ob_start ();
4040 // phpcs:ignore Squiz.PHP.Eval.Discouraged -- This is meant to be a REPL, no way to avoid eval.
41- eval ( $ line );
42- $ out = (string ) ob_get_clean ();
43- if ( 0 < strlen ( $ out ) ) {
44- $ out = rtrim ( $ out , "\n" ) . "\n" ;
41+ eval ( $ __repl_input_line );
42+ $ __repl_output = (string ) ob_get_clean ();
43+ if ( 0 < strlen ( $ __repl_output ) ) {
44+ $ __repl_output = rtrim ( $ __repl_output , "\n" ) . "\n" ;
4545 }
46- fwrite ( STDOUT , $ out );
46+ fwrite ( STDOUT , $ __repl_output );
4747 } else {
48- if ( ! self ::starts_with ( 'return ' , $ line ) ) {
49- $ line = 'return ' . $ line ;
48+ if ( ! self ::starts_with ( 'return ' , $ __repl_input_line ) ) {
49+ $ __repl_input_line = 'return ' . $ __repl_input_line ;
5050 }
5151
5252 // Write directly to STDOUT, to sidestep any output buffers created by plugins
5353 ob_start ();
5454 // phpcs:ignore Squiz.PHP.Eval.Discouraged -- This is meant to be a REPL, no way to avoid eval.
55- $ evl = eval ( $ line );
56- $ out = (string ) ob_get_clean ();
57- if ( 0 < strlen ( $ out ) ) {
58- echo rtrim ( $ out , "\n" ) . "\n" ;
55+ $ __repl_eval_result = eval ( $ __repl_input_line );
56+ $ __repl_output = (string ) ob_get_clean ();
57+ if ( 0 < strlen ( $ __repl_output ) ) {
58+ echo rtrim ( $ __repl_output , "\n" ) . "\n" ;
5959 }
6060 ob_start ();
6161 if ( ! $ this ->quiet ) {
6262 echo '=> ' ;
63- var_dump ( $ evl );
63+ var_dump ( $ __repl_eval_result );
6464 }
6565 fwrite ( STDOUT , (string ) ob_get_clean () );
6666 }
0 commit comments