CompileCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A handle() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
10
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
 * THE SOFTWARE.
12
 *
13
 * This software consists of voluntary contributions made by many individuals
14
 * and is licensed under the MIT license.
15
 *
16
 * Copyright (c) 2015-2020 Yuuki Takezawa
17
 *
18
 */
19
20
namespace Ytake\LaravelAspect\Console;
21
22
use Illuminate\Console\Command;
23
use Ytake\LaravelAspect\AspectManager;
24
25
/**
26
 * Class ClearCacheCommand
27
 */
28
class CompileCommand extends Command
29
{
30
    /** @var string */
31
    protected $name = 'ytake:aspect-compile';
32
33
    /** @var string */
34
    protected $description = 'compiles all known classes';
35
36
    /** @var AspectManager */
37
    protected $aspectManager;
38
39
    /**
40
     * CompileCommand constructor.
41
     *
42
     * @param AspectManager $aspectManager
43
     */
44
    public function __construct(AspectManager $aspectManager)
45
    {
46
        parent::__construct();
47
        $this->aspectManager = $aspectManager;
48
    }
49
50
    /**
51
     * @return void
52
     */
53
    public function handle(): void
54
    {
55
        $this->aspectManager->weave();
56
        $this->info('class files compiled!');
57
    }
58
}
59