GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0bca18...1262c4 )
by Alireza
27s queued 19s
created

CreateModelObserverCommand::getStub()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace  Serverfireteam\Panel\Commands;
2
3
use Illuminate\Console\GeneratorCommand;
4
use Illuminate\Support\Str;
5
use Symfony\Component\Console\Input\InputOption;
6
7
class CreateModelObserverCommand extends GeneratorCommand {
8
9
	/**	
10
	 *
11
	 * @var string contains the command name
12
	 */
13
	protected $name = 'panel:createobserver';
14
15
	/**	
16
	 *
17
	 * @var string contains the description of command
18
	 */
19
	protected $description = 'Create a new observer model class';
20
21
	/**
22
	 * The type of class being generated.
23
	 *
24
	 * @var string
25
	 */
26
	protected $type = 'Observer';
27
28
	/**
29
	 * Get the stub file for the generator.
30
	 *
31
	 * @return string Returns the stub file for generating the Observer
32
	 */
33
	protected function getStub()
34
	{
35
        return base_path().'/vendor/serverfireteam/panel/src/Serverfireteam/Panel/stubs/observer.stub';
36
	}
37
38
	/**
39
	 * Get the default namespace for the class.
40
	 *
41
	 * @param  string  $rootNamespace
42
	 * @return string The namespace of the panel's observers
43
	 */
44
	protected function getDefaultNamespace($rootNamespace)
45
	{
46
        return $rootNamespace.'\Observers';
47
	}
48
        
49
     /**
50
	 * Execute the console command.
51
	 *
52
	 * @return void
53
	 */
54 View Code Duplication
	public function handle()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
55
	{
56
           	$name = $this->qualifyClass($this->getNameInput());
57
            
58
            if ($this->files->exists($path = $this->getPath($name . 'Observer')))
59
            {
60
                return $this->error($this->type.' already exists!');
61
            }
62
63
            $this->makeDirectory($path);
64
            
65
            $this->files->put($path, $this->buildClass($name));
66
67
            $this->info($this->type.' created successfully.');
68
	}
69
}
70