コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: Day1.php プロジェクト: stefanotorresi/thorr-advent
 /**
  * {@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);
 }
コード例 #3
0
ファイル: Day6.php プロジェクト: stefanotorresi/thorr-advent
 /**
  * {@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);
 }
コード例 #4
0
ファイル: Day3.php プロジェクト: stefanotorresi/thorr-advent
 /**
  * {@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);
 }