Passed
Push — master ( f6d7ec...2dd68c )
by Borislav
04:41
created

getRequiredArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php namespace App\Command;
2
3
use Symfony\Component\Console\Input\InputInterface;
4
use Symfony\Component\Console\Output\OutputInterface;
5
use App\Service\ContentService;
6
7
class UpdateBookInfoFromBibliomanCommand extends Command {
8
9
	public function getName() {
10
		return 'db:update-book-info-from-biblioman';
11
	}
12
13
	protected function getRequiredArguments() {
14
		return [
15
			'id' => 'A book ID',
16
		];
17
	}
18
19
	protected function execute(InputInterface $input, OutputInterface $output) {
20
		$book = $this->getEntityManager()->getBookRepository()->find($input->getArgument('id'));
21
		$file = ContentService::getInternalContentFilePath('book-info', $book->getId());
22
		file_put_contents($file, ContentService::generateBookInfoFromBiblioman($book->getBibliomanId()));
23
		$output->writeln("Info written to $file");
24
	}
25
}
26