Completed
Push — master ( f8521b...883f3c )
by Vagner Luz do
14:27
created

TinkerCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A fire() 0 6 1
A handle() 0 4 1
A getArguments() 0 6 1
1
<?php
2
3
/*
4
 * This is a partial modification of Illuminate\Framework
5
 * and that is licenced by MIT License (MIT)
6
 * Copyright (c) <Taylor Otwell>
7
 */
8
9
namespace Vluzrmos\Tinker;
10
11
use Illuminate\Console\Command;
12
use Symfony\Component\Console\Input\InputArgument;
13
14
/**
15
 * Class TinkerCommand.
16
 */
17
class TinkerCommand extends Command
18
{
19
    /**
20
     * Command Name.
21
     * @var string
22
     */
23
    protected $name = 'tinker';
24
25
    /**
26
     * The console command description.
27
     *
28
     * @var string
29
     */
30
    protected $description = 'Interact with your application';
31
32
    protected $shell;
33
34
    public function __construct(TinkerShell $shell)
35
    {
36
        parent::__construct();
37
38
        $this->shell = $shell;
39
    }
40
41
    /**
42
     *  Performs the event.
43
     */
44
    public function fire()
45
    {
46
        $this->getApplication()->setCatchExceptions(false);
47
48
        $this->shell->setIncludes($this->argument('include'))->run();
49
    }
50
51
    /**
52
     *  Performs the event.
53
     */
54
    public function handle()
55
    {
56
        $this->fire();
57
    }
58
    
59
    /**
60
     * Get the console command arguments.
61
     *
62
     * @return array
63
     */
64
    protected function getArguments()
65
    {
66
        return [
67
            ['include', InputArgument::IS_ARRAY, 'Include file(s) before starting tinker'],
68
        ];
69
    }
70
}
71