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 ( f85b6d...dc1691 )
by Shea
7s
created

MakeControllerCommand::getArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Caffeinated\Modules\Console\Generators;
4
5
class MakeControllerCommand extends MakeCommand
6
{
7
	/**
8
     * The name and signature of the console command.
9
     *
10
     * @var string
11
     */
12
    protected $signature = 'make:module:controller
13
    	{slug : The slug of the module}
14
    	{name : The name of the controller class}
15
    	{--resource : Generate a module resource controller class}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Create a new module controller class';
23
24
    /**
25
     * String to store the command type.
26
     *
27
     * @var string
28
     */
29
    protected $type = 'Controller';
30
31
    /**
32
     * Module folders to be created.
33
     *
34
	 * @var array
35
	 */
36
	protected $listFolders = [
37
		'Http/Controllers/'
38
	];
39
40
	/**
41
     * Module files to be created.
42
     *
43
	 * @var array
44
	 */
45
	protected $listFiles = [
46
		'{{filename}}.php'
47
	];
48
49
	/**
50
     * Module signature option.
51
     *
52
	 * @var array
53
	 */
54
	protected $signOption = [
55
		'resource'
56
	];
57
58
	/**
59
     * Module stubs used to populate defined files.
60
     *
61
	 * @var array
62
	 */
63
	protected $listStubs = [
64
		'default' => [
65
			'controller.stub'
66
		],
67
		
68
		'resource' => [
69
			'controller_resource.stub'
70
		]
71
	];
72
73
	/**
74
     * Resolve Container after getting file path
75
     * 
76
     * @param  string $FilePath
0 ignored issues
show
Documentation introduced by
There is no parameter named $FilePath. Did you maybe mean $filePath?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
77
     * @return Array
78
     */
79
    protected function resolveByPath($filePath)
80
    {
81
    	$this->container['filename'] 	= $this->makeFileName($filePath);
82
		$this->container['namespace']	= $this->getNamespace($filePath);
83
		$this->container['classname'] 	= basename($filePath);
84
    }
85
86
    /**
87
	 * Replace placeholder text with correct values.
88
	 *
89
	 * @return string
90
	 */
91
	protected function formatContent($content)
92
    {
93
        return str_replace(
94
			[
95
				'{{filename}}',
96
				'{{namespace}}', 
97
				'{{classname}}'
98
			],
99
			[
100
				$this->container['filename'], 
101
				$this->container['namespace'], 
102
				$this->container['classname']
103
			],
104
			$content
105
		);
106
    }
107
}