protected function marshallParts(InputInterface $input) : array
 {
     $parts = $input->getOption('part');
     $invalidParts = array_diff($parts, $this->validParts);
     Assertion::noContent($invalidParts, sprintf('Invalid parts specified: %s', implode(', ', $invalidParts)));
     if (in_array(static::PART_ALL, $parts)) {
         $parts = $this->puzzle->getPartMethods();
     }
     return $parts;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function __construct(string $name = "Not Quite Lisp", array $parts = ['floor' => 'Santa is at floor <info>%d</info>', 'basement' => 'Santa entered the basement after stepping into <info>%d</info> floors'])
 {
     parent::__construct($name, $parts);
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function __construct(string $name = "Probably a Fire Hazard", array $parts = ['lights' => 'There are <info>%d</info> lights lit', 'brightness' => 'The total brightness is <info>%d</info>'])
 {
     parent::__construct($name, $parts);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function __construct(string $name = "Perfectly Spherical Houses in a Vacuum", array $parts = ['houses' => 'Santa delivered at least one present in <info>%d</info> houses', 'robo' => 'Santa together with Robo-Santa delivered at least one present in <info>%d</info> houses'])
 {
     parent::__construct($name, $parts);
 }