protected function execute(InputInterface $input, OutputInterface $output)
 {
     $project = new Project(['id' => getenv('PROJECT_ID')]);
     $output->writeln('<comment>Calculating your remaining hours.. [Internet speed dependent.. sorry]</comment>');
     $remaining = $project->remainingHours();
     $output->writeln("<info>You have {$remaining} hour/s left! ヽ(゚〇゚)ノ</info>");
 }
Example #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $project = new Project(['id' => getenv('PROJECT_ID')]);
     if (($hours = $project->remainingHours()) > 0) {
         throw Table::out("You have {$hours} hour/s remaining dammit! LOG IT! (╯°□°)╯︵ ┻━┻");
     }
     if ($this->hasLogged()) {
         $output->writeln("<info>You're already out! ( ̄﹃ ̄)</info>");
         exit;
     }
     if (!$this->inTheOffice()) {
         throw Tantrum::overtime();
     }
     $output->writeln("<info>Peace out! (╯°□°)╯︵ ┻━┻</info>");
     (new Skype())->send('out');
     $this->cacheTimeOut();
 }
Example #3
0
 /**
  * Get the rendered hours.
  *
  * @param  InputInterface  $input
  * @param  OutputInterface  $output
  * @param  Project  $project
  * @return float
  */
 public function getRenderedHours(InputInterface $input, OutputInterface $output, Project $project)
 {
     $remaining = $project->remainingHours();
     if ($this->isForced && ($hours = $input->getOption('hours'))) {
         return $hours;
     }
     $hours = (double) $this->promptRenderedHours($input, $output, $remaining);
     if (!$hours) {
         $this->exit($output);
     }
     if ($hours > $remaining) {
         $output->writeln('<error>Rendered hours input is not valid.</error>');
         $this->exit($output);
     }
     return $hours;
 }