StatRealpathSizeCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 22
ccs 5
cts 9
cp 0.5556
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 6 1
A configure() 0 6 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 25
    protected function configure()
25
    {
26
        $this
27 25
            ->setName('stat:realpath_size')
28 25
            ->setDescription('Display size of realpath cache')
29 25
            ->setHelp('');
30 25
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output): int
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
        return 0;
41
    }
42
}
43