Test Failed
Push — main ( 94eef3...96fa17 )
by Dimitri
14:06
created

ClearDebugbar   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 13 2
1
<?php
2
3
/**
4
 * This file is part of Blitz PHP framework.
5
 *
6
 * (c) 2022 Dimitri Sitchet Tomkeu <[email protected]>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace BlitzPHP\Cli\Commands\Housekeeping;
13
14
use BlitzPHP\Cli\Console\Command;
15
16
/**
17
 * Vide les fichiers de la toolbar
18
 */
19
class ClearDebugbar extends Command
20
{
21
    /**
22
     * {@inheritDoc}
23
     */
24
    protected $group = 'Housekeeping';
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    protected $name = 'debugbar:clear';
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    protected $description = 'Efface tous les fichiers JSON de la debugbar.';
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function execute(array $params)
40
    {
41
        helper('filesystem');
42
43
        if (! delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) {
44
            // @codeCoverageIgnoreStart
45
            $this->error('Erreur lors de la suppression des fichiers de la debugbar.')->eol();
46
47
            return;
48
            // @codeCoverageIgnoreEnd
49
        }
50
51
        $this->success('Debugbar netoyée.')->eol();
52
    }
53
}
54