PrintCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
namespace wapmorgan\UnifiedArchive\Commands;
4
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use wapmorgan\UnifiedArchive\UnifiedArchive;
8
9
class PrintCommand extends BaseFileCommand
10
{
11
    protected static $defaultName = 'file:print';
12
13
    protected function configure()
14
    {
15
        parent::configure();
16
        $this
17
            ->setDescription('Renders RAW archive file content')
18
            ->setHelp('Renders RAW archive file content.')
19
        ;
20
    }
21
22
    public function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        /** @var $archive UnifiedArchive */
25
        list($archive, $file) = $this->getArchiveAndFile($input, $output);
26
        fpassthru($archive->getFileStream($file));
27
28
        return 0;
29
    }
30
}
31