/** * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $host = $input->getArgument(self::HOST_ARGUMENT); $baseUrl = sprintf('http://%s:%d', $host, AppleTvClient::AIRPLAY_DEFAULT_PORT); $output->writeln(sprintf("Connecting to %s", $baseUrl)); $output->writeln('Press Ctrl-c to quit'); $client = new Client(['base_url' => $baseUrl]); if ($input->hasOption(self::UTILITY_OPTION)) { $this->mirror->setUtility($input->getOption(self::UTILITY_OPTION)); } while (true) { $this->mirror->reflect(); $this->putPhoto($output, $client, file_get_contents($this->mirror->getImage())); $this->getApplication()->getFilesystem()->remove($this->mirror->getImage()); } }
function let(Mirror $mirror) { $mirror->getSupportedUtilities()->willReturn([]); $this->beConstructedWith('mirror', $mirror); }