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.
Passed
Push — master ( 86dce3...98cf71 )
by Nur
02:40
created

Make   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 32
dl 0
loc 100
rs 10
c 0
b 0
f 0
wmc 7

5 Methods

Rating   Name   Duplication   Size   Complexity  
A optionNamespace() 0 3 1
A getPhpTemplateFile() 0 4 1
A optionPath() 0 11 2
A optionFilename() 0 6 2
A optionName() 0 3 1
1
<?php
2
/**
3
 * This file is part of the O2System PHP Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Reactor\Cli\Commanders;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Kernel\Cli\Commander;
19
20
/**
21
 * Class Make
22
 *
23
 * @package O2System\Reactor\Cli\Commanders
24
 */
25
class Make extends Commander
26
{
27
    /**
28
     * Make::$commandVersion
29
     *
30
     * Command version.
31
     *
32
     * @var string
33
     */
34
    protected $commandVersion = '1.0.0';
35
36
    /**
37
     * Make::$commandDescription
38
     *
39
     * Command description.
40
     *
41
     * @var string
42
     */
43
    protected $commandDescription = 'CLI_MAKE_DESC';
44
45
    /**
46
     * Make::$commandOptions
47
     *
48
     * Command options.
49
     *
50
     * @var array
51
     */
52
    protected $commandOptions = [
53
        'name'      => [
54
            'description' => 'CLI_MAKE_NAME_DESC',
55
            'required'    => true,
56
        ],
57
        'path'      => [
58
            'description' => 'CLI_MAKE_PATH_DESC',
59
            'required'    => false,
60
        ],
61
        'filename'  => [
62
            'description' => 'CLI_MAKE_FILENAME_DESC',
63
            'required'    => true,
64
        ],
65
        'namespace' => [
66
            'description' => 'CLI_MAKE_NAMESPACE_DESC',
67
            'shortcut'    => 'ns',
68
            'required'    => false,
69
        ],
70
    ];
71
72
    /**
73
     * Make::$path
74
     *
75
     * Make path.
76
     *
77
     * @var string
78
     */
79
    protected $optionPath;
80
81
    /**
82
     * Make::$filename
83
     *
84
     * Make filename.
85
     *
86
     * @var string
87
     */
88
    protected $optionFilename;
89
90
    public function optionPath($path)
91
    {
92
        $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
93
        $path = PATH_ROOT . str_replace(PATH_ROOT, '', $path);
0 ignored issues
show
Bug introduced by
The constant O2System\Reactor\Cli\Commanders\PATH_ROOT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
94
95
        if (pathinfo($path, PATHINFO_EXTENSION)) {
96
            $this->optionFilename(pathinfo($path, PATHINFO_FILENAME));
97
            $path = dirname($path);
98
        }
99
100
        $this->optionPath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
101
    }
102
103
    public function optionFilename($name)
104
    {
105
        $name = str_replace('.php', '', $name);
106
        $this->optionFilename = prepare_filename($name) . '.php';
107
108
        $this->optionPath = empty($this->optionPath) ? modules()->current()->getRealPath() : $this->optionPath;
0 ignored issues
show
Bug introduced by
The function modules was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

108
        $this->optionPath = empty($this->optionPath) ? /** @scrutinizer ignore-call */ modules()->current()->getRealPath() : $this->optionPath;
Loading history...
109
    }
110
111
    public function optionName($name)
112
    {
113
        $this->optionFilename($name);
114
    }
115
116
    public function optionNamespace($namespace)
117
    {
118
        $this->namespace = $namespace;
0 ignored issues
show
Bug Best Practice introduced by
The property namespace does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
119
    }
120
121
    public function getPhpTemplateFile($filename)
0 ignored issues
show
Unused Code introduced by
The parameter $filename is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

121
    public function getPhpTemplateFile(/** @scrutinizer ignore-unused */ $filename)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
122
    {
123
        $directories = [
0 ignored issues
show
Unused Code introduced by
The assignment to $directories is dead and can be removed.
Loading history...
124
            PATH_FRAMEWORK . 'Config' . DIRECTORY_SEPARATOR . 'PhpTemplateFiles',
125
        ];
126
127
    }
128
}