Issues (4)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Commands/ActionMakeCommand.php (4 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace BrightComponents\Actions\Commands;
4
5
use Illuminate\Support\Facades\Config;
6
use Illuminate\Console\GeneratorCommand;
7
8
class ActionMakeCommand extends GeneratorCommand
9
{
10
    /**
11
     * The console command name.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'adr:action {name}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Create a new action';
23
24
    /**
25
     * The type of class being generated.
26
     *
27
     * @var string
28
     */
29
    protected $type = 'Action';
30
31
    /**
32
     * Get the stub file for the generator.
33
     *
34
     * @return string
35
     */
36
    protected function getStub()
37
    {
38
        return __DIR__.'/stubs/action.stub';
39
    }
40
41
    /**
42
     * Get the default namespace for the class.
43
     *
44
     * @param  string  $rootNamespace
0 ignored issues
show
There is no parameter named $rootNamespace. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
45
     *
46
     * @return string
47
     */
48
    protected function getMethodName()
49
    {
50
        return Config::get('actions.method', '__invoke');
51
    }
52
53
    /**
54
     * Get the default namespace for the class.
55
     *
56
     * @param  string  $rootNamespace
57
     *
58
     * @return string
59
     */
60
    protected function getDefaultNamespace($rootNamespace)
61
    {
62
        return $rootNamespace.'\\'.Config::get('actions.namespace', '');
63
    }
64
65
    /**
66
     * Get the desired class name from the input.
67
     *
68
     * @return string
69
     */
70
    protected function getNameInput()
71
    {
72
        $input = $input = studly_case(trim($this->argument('name')));
0 ignored issues
show
Deprecated Code introduced by
The function studly_case() has been deprecated with message: Str::studly() should be used directly instead. Will be removed in Laravel 5.9.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
73
        $suffix = Config::get('actions.suffix');
74
75
        if (Config::get('actions.override_duplicate_suffix')) {
76
            return str_finish($input, $suffix);
0 ignored issues
show
Deprecated Code introduced by
The function str_finish() has been deprecated with message: Str::finish() should be used directly instead. Will be removed in Laravel 5.9.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
77
        }
78
79
        return $input.$suffix;
80
    }
81
82
    /**
83
     * Build the class with the given name.
84
     *
85
     * @param  string  $name
86
     *
87
     * @return string
88
     */
89
    protected function buildClass($name)
90
    {
91
        $stub = $this->files->get($this->getStub());
92
93
        return $this->replaceNamespace($stub, $name)->replaceMethod($stub)->replaceClass($stub, $name);
94
    }
95
96
    /**
97
     * Replace the method name in the given stub.
98
     *
99
     * @param  string  $stub
100
     * @param  string  $name
0 ignored issues
show
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

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

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

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

Loading history...
101
     *
102
     * @return $this
103
     */
104
    protected function replaceMethod(&$stub)
105
    {
106
        $stub = str_replace(
107
            ['DummyMethod'],
108
            [$this->getMethodName()],
109
            $stub
110
        );
111
112
        return $this;
113
    }
114
}
115