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>");
 }
Esempio n. 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $session = $this->scrumSession($input, $output);
     $output->writeln('Scrum ended after ' . $session->format('%i minutes and %s seconds'));
     $output->writeln('Sending SCRUM log to basecamp...');
     $project = new Project(['id' => getenv('PROJECT_ID')]);
     $basecampHours = $session->format('%i') / ($minutes = 60);
     $project->log('SCRUM', $basecampHours);
 }
Esempio n. 3
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();
 }
Esempio n. 4
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;
 }