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/Application/Application.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
/*
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\Application;
13
14
use Webmozart\Console\Api\Args\Format\ArgsFormat;
15
use Webmozart\Console\Api\Args\RawArgs;
16
use Webmozart\Console\Api\Command\Command;
17
use Webmozart\Console\Api\Command\CommandCollection;
18
use Webmozart\Console\Api\Command\NoSuchCommandException;
19
use Webmozart\Console\Api\Config\ApplicationConfig;
20
use Webmozart\Console\Api\IO\InputStream;
21
use Webmozart\Console\Api\IO\OutputStream;
22
use Webmozart\Console\Api\Resolver\CannotResolveCommandException;
23
use Webmozart\Console\Api\Resolver\ResolvedCommand;
24
25
/**
26
 * A console application.
27
 *
28
 * @since  1.0
29
 *
30
 * @author Bernhard Schussek <[email protected]>
31
 */
32
interface Application
33
{
34
    /**
35
     * Returns the application configuration.
36
     *
37
     * @return ApplicationConfig The application configuration.
38
     */
39
    public function getConfig();
40
41
    /**
42
     * Returns the global arguments format of the application.
43
     *
44
     * @return ArgsFormat The global arguments format.
45
     */
46
    public function getGlobalArgsFormat();
47
48
    /**
49
     * Returns the command for a given name.
50
     *
51
     * @param string $name The name of the command.
52
     *
53
     * @return Command The command.
54
     *
55
     * @throws NoSuchCommandException If the command is not found.
56
     *
57
     * @see addCommand(), getCommands()
58
     */
59
    public function getCommand($name);
60
61
    /**
62
     * Returns all registered commands.
63
     *
64
     * @return CommandCollection The commands.
65
     *
66
     * @see addCommand(), getCommand()
67
     */
68
    public function getCommands();
69
70
    /**
71
     * Returns whether the application has a command with a given name.
72
     *
73
     * @param string $name The name of the command.
74
     *
75
     * @return bool Returns `true` if the command with the given name exists and
76
     *              `false` otherwise.
77
     *
78
     * @see hasCommands(), getCommand()
79
     */
80
    public function hasCommand($name);
81
82
    /**
83
     * Returns whether the application has any registered commands.
84
     *
85
     * @return bool Returns `true` if the application has any commands and
86
     *              `false` otherwise.
87
     *
88
     * @see hasCommand(), getCommands()
89
     */
90
    public function hasCommands();
91
92
    /**
93
     * Returns the commands that are not anonymous.
94
     *
95
     * @return CommandCollection The named commands.
96
     */
97
    public function getNamedCommands();
98
99
    /**
100
     * Returns whether the application has any commands that are not anonymous.
101
     *
102
     * @return bool Returns `true` if the application has named commands and
103
     *              `false` otherwise.
104
     *
105
     * @see getNamedCommands()
106
     */
107
    public function hasNamedCommands();
108
109
    /**
110
     * Returns the commands that should be executed if no explicit command is
111
     * passed.
112
     *
113
     * @return CommandCollection The default commands.
114
     */
115
    public function getDefaultCommands();
116
117
    /**
118
     * Returns whether the application has any default commands.
119
     *
120
     * @return bool Returns `true` if the application has default commands and
121
     *              `false` otherwise.
122
     *
123
     * @see getDefaultCommands()
124
     */
125
    public function hasDefaultCommands();
126
127
    /**
128
     * Returns the command to execute for the given console arguments.
129
     *
130
     * @param RawArgs $args The console arguments.
131
     *
132
     * @return ResolvedCommand The command to execute.
133
     *
134
     * @throws CannotResolveCommandException If the command cannot be resolved.
135
     */
136
    public function resolveCommand(RawArgs $args);
137
138
    /**
139
     * Executes the command.
140
     *
141
     * @param RawArgs      $args         The console arguments. If not given,
0 ignored issues
show
Should the type for parameter $args not be null|RawArgs?

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...
142
     *                                   the arguments passed to the PHP process
143
     *                                   are used.
144
     * @param InputStream  $inputStream  The standard input. If not given, the
0 ignored issues
show
Should the type for parameter $inputStream not be null|InputStream?

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...
145
     *                                   application reads from the standard
146
     *                                   input of the PHP process.
147
     * @param OutputStream $outputStream The standard output. If not given, the
0 ignored issues
show
Should the type for parameter $outputStream not be null|OutputStream?

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...
148
     *                                   application prints to the standard
149
     *                                   output of the PHP process.
150
     * @param OutputStream $errorStream  The error output. If not given, the
0 ignored issues
show
Should the type for parameter $errorStream not be null|OutputStream?

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...
151
     *                                   application prints to the error output
152
     *                                   of the PHP process.
153
     *
154
     * @return int The exit status.
155
     */
156
    public function run(RawArgs $args = null, InputStream $inputStream = null, OutputStream $outputStream = null, OutputStream $errorStream = null);
157
}
158