Issues (283)

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/Api/Config/SubCommandConfig.php (2 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
/*
4
 * This file is part of the webmozart/console package.
5
 *
6
 * (c) Bernhard Schussek <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Webmozart\Console\Api\Config;
13
14
/**
15
 * The configuration of an console sub-command.
16
 *
17
 * A sub-command is defined within the scope of another command. For example,
18
 * in the command `server add <host>`, the command "add" is a sub-command of the
19
 * "server" command.
20
 *
21
 * @since  1.0
22
 *
23
 * @author Bernhard Schussek <[email protected]>
24
 *
25
 * @see    OptionCommandConfig
26
 */
27
class SubCommandConfig extends CommandConfig
28
{
29
    /**
30
     * @var CommandConfig
31
     */
32
    private $parentConfig;
33
34
    /**
35
     * Creates a new configuration.
36
     *
37
     * @param string        $name         The name of the command.
0 ignored issues
show
Should the type for parameter $name not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
38
     * @param CommandConfig $parentConfig The command configuration that
0 ignored issues
show
Should the type for parameter $parentConfig not be null|CommandConfig?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
39
     *                                    contains this configuration.
40
     */
41 85
    public function __construct($name = null, CommandConfig $parentConfig = null)
42
    {
43 85
        parent::__construct($name);
44
45 85
        if ($parentConfig) {
46 22
            $this->setParentConfig($parentConfig);
47
        }
48 85
    }
49
50
    /**
51
     * Returns the parent command configuration.
52
     *
53
     * @return CommandConfig The parent command configuration.
54
     */
55 4
    public function getParentConfig()
56
    {
57 4
        return $this->parentConfig;
58
    }
59
60
    /**
61
     * Sets the parent command configuration.
62
     *
63
     * @param CommandConfig $parentConfig The parent command configuration.
64
     */
65 50
    public function setParentConfig(CommandConfig $parentConfig)
66
    {
67 50
        $this->parentConfig = $parentConfig;
68
69 50
        if ($parentConfig->getApplicationConfig()) {
70 30
            $this->setApplicationConfig($parentConfig->getApplicationConfig());
71
        }
72 50
    }
73
74
    /**
75
     * Ends the block when dynamically configuring a nested configuration.
76
     *
77
     * This method is usually used together with
78
     * {@link CommandConfig::beginSubCommand()},
79
     * {@link CommandConfig::beginOptionCommand()} or
80
     * {@link CommandConfig::beginDefaultCommand()}:
81
     *
82
     * ```php
83
     * $config
84
     *     ->beginSubCommand('add')
85
     *         // ...
86
     *     ->end()
87
     *
88
     *     // ...
89
     * ;
90
     * ```
91
     *
92
     * @return CommandConfig|SubCommandConfig|OptionCommandConfig The parent command configuration.
93
     */
94 14
    public function end()
95
    {
96 14
        return $this->parentConfig;
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102 1
    protected function getDefaultHelperSet()
103
    {
104 1
        return $this->parentConfig
105 1
            ? $this->parentConfig->getHelperSet()
106 1
            : parent::getDefaultHelperSet();
107
    }
108
109
    /**
110
     * {@inheritdoc}
111
     */
112 1
    protected function getDefaultHandler()
113
    {
114 1
        return $this->parentConfig
115 1
            ? $this->parentConfig->getHandler()
116 1
            : parent::getDefaultHandler();
117
    }
118
119
    /**
120
     * {@inheritdoc}
121
     */
122 5
    protected function getDefaultHandlerMethod()
123
    {
124 5
        return $this->parentConfig
125 5
            ? $this->parentConfig->getHandlerMethod()
126 5
            : parent::getDefaultHandlerMethod();
127
    }
128
129
    /**
130
     * {@inheritdoc}
131
     */
132 127
    protected function getDefaultArgsParser()
133
    {
134 127
        return $this->parentConfig
135 127
            ? $this->parentConfig->getArgsParser()
136 127
            : parent::getDefaultArgsParser();
137
    }
138
139
    /**
140
     * {@inheritdoc}
141
     */
142 127
    protected function getDefaultLenientArgsParsing()
143
    {
144 127
        return $this->parentConfig
145 127
            ? $this->parentConfig->isLenientArgsParsingEnabled()
146 127
            : parent::getDefaultLenientArgsParsing();
147
    }
148
}
149