Completed
Pull Request — 1.x (#35)
by
unknown
18:26
created

StatRealpathSizeCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 4
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of CacheTool.
5
 *
6
 * (c) Samuel Gordalina <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CacheTool\Command;
13
14
use CacheTool\Util\Formatter;
15
use Symfony\Component\Console\Helper\TableSeparator;
16
use Symfony\Component\Console\Input\InputInterface;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
class StatRealpathSizeCommand extends AbstractCommand
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected function configure()
25
    {
26
        $this
27
            ->setName('stat:realpath_size')
28
            ->setDescription('Display size of realpath cache')
29
            ->setHelp('');
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output)
36
    {
37
        $size = $this->getCacheTool()->stat_realpath_size();
38
        $output->writeln(sprintf("<comment>Realpath cache size: <info>%s</info></comment>", Formatter::bytes($size)));
39
    }
40
}
41