src/main/php/de/codenamephp/prototype/utils/answerCollector/CollectorSwitch.php
public function getAnswers(\Composer\Script\Event $event, array $questions, \SplFileInfo $file): array {
    if($event->getIO()->isInteractive()) {
      $answers = $this->getComposerIO()->getAnswers($event->getIO(), $questions);
    }else {
      $answers = $this->getFromArray()->getAnswers($file);
    }
    return $answers;
  }
public function getAnswers(\Composer\Script\Event $event, array $questions, \SplFileInfo $file): array {
    if($event->getIO()->isInteractive()) {
      $answers = $this->getComposerIO()->getAnswers($event->getIO(), $questions);
    }else {
      $answers = $this->getFromArray()->getAnswers($file);
    }
    return $answers;
  }
public function getAnswers ( \ Composer \ Script \ Event $ event , array $ questions , \ SplFileInfo $ file ) : array { if ( $ event -> getIO ( ) -> isInteractive ( ) ) { $ answers = $ this -> getComposerIO ( ) -> getAnswers ( $ event -> getIO ( ) , $ questions ) ; } else { $ answers = $ this -> getFromArray ( ) -> getAnswers ( $ file ) ; } return $ answers ; }
Checks if the IO is interactive. If so, it passes the IO and the questions to the ComposerIO collector.

If not, it passes the file to the FromSerializedArrayFile collector.

@param \Composer\Script\Event $event
@param \de\codenamephp\platform\cli\question\iQuestion[string] $questions
@param \SplFileInfo $file
@return array
Checks if the IO is interactive . If so it passes the IO and the questions to the ComposerIO collector .