/** * @return int */ public function getTotalAttachmentSize() { $totalSize = 0; foreach ($this->projects as $project) { foreach ($project->stories as $story) { $totalSize += array_sum(collection_column($story->attachments, 'sizeInBytes')); } } return $totalSize; }
protected function execute(InputInterface $input, OutputInterface $output) { $this->dump = Dump::load($input->getOption('output-dir')); $map = []; foreach ($this->dump->projects as $project) { $phases = collection_column($project->phases, 'name'); $statuses = array_keys($this->redmine->api('issue_status')->listing()); $map[$project->id] = []; $output->writeln("For project #{$project->id} '{$project->name}':"); foreach ($phases as $phase) { $helper = $this->getHelper('question'); $question = new ChoiceQuestion("Map the AgileZen phase '{$phase}' to Redmine status:", $statuses); $question->setErrorMessage('Invalid status.'); $map[$project->id][$phase] = $helper->ask($input, $output, $question); } } $this->dump->phaseMap = $map; $this->dump->write(); }