File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,18 @@ public function installHyperfScript()
124124 $ ask [] = "\n <question>What time zone do you want to setup ?</question> \n" ;
125125 $ ask [] = " [<comment>n</comment>] Default time zone for php.ini \n" ;
126126 $ ask [] = "Make your selection or type a time zone name, like Asia/Shanghai (n): \n" ;
127- $ answer = $ this ->io ->ask (implode ('' , $ ask ), 'n ' );
127+ $ answer = $ this ->io ->askAndValidate (
128+ implode ('' , $ ask ),
129+ function ($ value ) {
130+ if ($ value === 'y ' || $ value === 'yes ' ) {
131+ throw new \InvalidArgumentException ("You should type a time zone name, like Asia/Shanghai. Or type n to skip. " );
132+ }
133+
134+ return $ value ;
135+ },
136+ null ,
137+ 'n '
138+ );
128139
129140 $ content = file_get_contents ($ this ->installerSource . '/resources/bin/hyperf.stub ' );
130141 if ($ answer != 'n ' ) {
You can’t perform that action at this time.
0 commit comments