ExpressiveInstaller\OptionalPackages::requestMinimal PHP Метод

requestMinimal() публичный статический Метод

Ask if the user would like a minimal install.
public static requestMinimal ( Composer\IO\IOInterface $io ) : boolean
$io Composer\IO\IOInterface
Результат boolean
    public static function requestMinimal(IOInterface $io)
    {
        $query = [sprintf("\n  <question>%s</question>\n", 'Minimal skeleton? (no default middleware, templates, or assets; configuration only)'), "  [<comment>y</comment>] Yes (minimal)\n", "  [<comment>n</comment>] No (full; recommended)\n", "  Make your selection <comment>(No)</comment>: "];
        while (true) {
            $answer = $io->ask($query, 'n');
            if (strtolower($answer) === 'n') {
                return false;
            }
            if (strtolower($answer) === 'y') {
                return true;
            }
            // @codeCoverageIgnoreStart
            $io->write("<error>Invalid answer</error>");
            // @codeCoverageIgnoreEnd
        }
        // This should never be reached, defaults to default answer
        // @codeCoverageIgnoreStart
        return false;
        // @codeCoverageIgnoreEnd
    }

Usage Example

 public function testRequestMinimalInstallIsFalse()
 {
     $io = $this->prophesize('Composer\\IO\\IOInterface');
     $io->ask(Argument::any(), Argument::any())->willReturn('n');
     $answer = OptionalPackages::requestMinimal($io->reveal());
     $this->assertFalse($answer);
 }