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

TinkerCommand::fire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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