@@ -120,6 +120,13 @@ public function __construct(IOInterface $io, Composer $composer, string $project
120120 $ this ->installerSource = realpath (__DIR__ ) . '/ ' ;
121121 }
122122
123+ public function installHyperfScript ()
124+ {
125+ $ answer = $ this ->io ->ask ('' , (string )'' );
126+
127+ var_dump ($ answer );
128+ }
129+
123130 /**
124131 * Create data and cache directories, if not present.
125132 *
@@ -130,7 +137,7 @@ public function setupRuntimeDir(): void
130137 $ this ->io ->write ('<info>Setup data and cache dir</info> ' );
131138 $ runtimeDir = $ this ->projectRoot . '/runtime ' ;
132139
133- if (! is_dir ($ runtimeDir )) {
140+ if (!is_dir ($ runtimeDir )) {
134141 mkdir ($ runtimeDir , 0775 , true );
135142 chmod ($ runtimeDir , 0775 );
136143 }
@@ -249,14 +256,14 @@ public function processAnswer(array $question, $answer): bool
249256 }
250257 // Copy files
251258 if (isset ($ question ['options ' ][$ answer ])) {
252- $ force = ! empty ($ question ['force ' ]);
259+ $ force = !empty ($ question ['force ' ]);
253260 foreach ($ question ['options ' ][$ answer ]['resources ' ] as $ resource => $ target ) {
254261 $ this ->copyResource ($ resource , $ target , $ force );
255262 }
256263 }
257264 return true ;
258265 }
259- if ($ question ['custom-package ' ] === true && preg_match (self ::PACKAGE_REGEX , (string ) $ answer , $ match )) {
266+ if ($ question ['custom-package ' ] === true && preg_match (self ::PACKAGE_REGEX , (string )$ answer , $ match )) {
260267 $ this ->addPackage ($ match ['name ' ], $ match ['version ' ], []);
261268 if (isset ($ question ['custom-package-warning ' ])) {
262269 $ this ->io ->write (sprintf (' <warning>%s</warning> ' , $ question ['custom-package-warning ' ]));
@@ -310,7 +317,7 @@ public function addPackage(string $packageName, string $packageVersion, array $w
310317 }
311318 // Whitelist packages for the component installer
312319 foreach ($ whitelist as $ package ) {
313- if (! in_array ($ package , $ this ->composerDefinition ['extra ' ]['zf ' ]['component-whitelist ' ], true )) {
320+ if (!in_array ($ package , $ this ->composerDefinition ['extra ' ]['zf ' ]['component-whitelist ' ], true )) {
314321 $ this ->composerDefinition ['extra ' ]['zf ' ]['component-whitelist ' ][] = $ package ;
315322 $ this ->io ->write (sprintf (' - Whitelist package <info>%s</info> ' , $ package ));
316323 }
@@ -331,7 +338,7 @@ public function copyResource(string $resource, string $target, bool $force = fal
331338 return ;
332339 }
333340 $ destinationPath = dirname ($ this ->projectRoot . $ target );
334- if (! is_dir ($ destinationPath )) {
341+ if (!is_dir ($ destinationPath )) {
335342 mkdir ($ destinationPath , 0775 , true );
336343 }
337344 $ this ->io ->write (sprintf (' - Copying <info>%s</info> ' , $ target ));
@@ -398,20 +405,20 @@ private function askQuestion(array $question, $defaultOption)
398405 : sprintf (' Make your selection <comment>(%s)</comment>: ' , $ defaultText );
399406 while (true ) {
400407 // Ask for user input
401- $ answer = $ this ->io ->ask (implode ($ ask ), (string ) $ defaultOption );
408+ $ answer = $ this ->io ->ask (implode ($ ask ), (string )$ defaultOption );
402409 // Handle none of the options
403410 if ($ answer === 'n ' && $ question ['required ' ] !== true ) {
404411 return 'n ' ;
405412 }
406413 // Handle numeric options
407- if (is_numeric ($ answer ) && isset ($ question ['options ' ][(int ) $ answer ])) {
408- return (int ) $ answer ;
414+ if (is_numeric ($ answer ) && isset ($ question ['options ' ][(int )$ answer ])) {
415+ return (int )$ answer ;
409416 }
410417 // Search for package
411418 if ($ question ['custom-package ' ] === true && preg_match (self ::PACKAGE_REGEX , $ answer , $ match )) {
412419 $ packageName = $ match ['name ' ];
413420 $ packageVersion = $ match ['version ' ];
414- if (! $ packageVersion ) {
421+ if (!$ packageVersion ) {
415422 $ this ->io ->write ('<error>No package version specified</error> ' );
416423 continue ;
417424 }
@@ -435,7 +442,7 @@ private function askQuestion(array $question, $defaultOption)
435442 */
436443 private function recursiveRmdir (string $ directory ): void
437444 {
438- if (! is_dir ($ directory )) {
445+ if (!is_dir ($ directory )) {
439446 return ;
440447 }
441448 $ rdi = new RecursiveDirectoryIterator ($ directory , FilesystemIterator::SKIP_DOTS );
0 commit comments