Issues (5)

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.

Selectors.php (1 issue)

Labels
Severity

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 Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace Cubiche\Core\Selector;
12
13
use Cubiche\Core\Visitor\VisitorInterface;
14
15
/**
16
 * Selector Builder Class.
17
 *
18
 * @method static Selectors key(string $name)
19
 * @method static Selectors property(string $name)
20
 * @method static Selectors method(string $name)
21
 * @method static Selectors callback(callable $callback)
22
 * @method static Selectors value($value)
23
 * @method static Selectors count()
24
 * @method static Selectors composite(SelectorInterface $x, SelectorInterface $y)
25
 * @method static Selectors this()
26
 *
27
 * @author Karel Osorio Ramírez <[email protected]>
28
 */
29
class Selectors extends Selector
30
{
31
    /**
32
     * @var SelectorFactoryInterface
33
     */
34
    protected static $factory;
35
36
    /**
37
     * @var SelectorInterface
38
     */
39
    private $selector;
40
41
    /**
42
     * @return \Cubiche\Core\Selector\SelectorFactoryInterface
43
     */
44
    protected static function factory()
45
    {
46
        if (self::$factory === null) {
47
            self::$factory = new SelectorFactory(__NAMESPACE__);
48
        }
49
50
        return self::$factory;
51
    }
52
53
    /**
54
     * @param string $selectorClass
55
     * @param string $selectorName
56
     */
57
    public static function addSelector($selectorClass, $selectorName = null)
58
    {
59
        self::factory()->addSelector($selectorClass, $selectorName);
60
    }
61
62
    /**
63
     * @param string $namespace
64
     */
65
    public static function addNamespace($namespace)
66
    {
67
        self::factory()->addNamespace($namespace);
68
    }
69
70
    /**
71
     * @param callable|mixed $selector
72
     *
73
     * @return \Cubiche\Core\Selector\Selectors
74
     */
75
    public static function from($selector)
76
    {
77
        return new static(Selector::from($selector));
78
    }
79
80
    /**
81
     * @param SelectorInterface $selector
82
     */
83
    protected function __construct(SelectorInterface $selector)
84
    {
85
        $this->selector = $selector;
86
    }
87
88
    /**
89
     * @param string $method
90
     * @param array  $arguments
91
     *
92
     * @return mixed
93
     */
94
    public static function __callStatic($method, $arguments)
95
    {
96
        return new static(self::factory()->create($method, $arguments));
97
    }
98
99
    /**
100
     * @param string $method
101
     * @param array  $args
0 ignored issues
show
There is no parameter named $args. 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...
102
     *
103
     * @return mixed
104
     */
105
    public function __call($method, $arguments)
106
    {
107
        return $this->select(self::factory()->create($method, $arguments));
108
    }
109
110
    /**
111
     * {@inheritdoc}
112
     */
113
    public function apply($value)
114
    {
115
        return $this->selector()->apply($value);
116
    }
117
118
    /**
119
     * {@inheritdoc}
120
     */
121
    public function select($selector)
122
    {
123
        $this->selector = $this->selector()->select($selector);
124
125
        return $this;
126
    }
127
128
    /**
129
     * {@inheritdoc}
130
     */
131
    public function accept(VisitorInterface $visitor)
132
    {
133
        return $this->delegateAccept($this->selector(), $visitor, \func_get_args());
134
    }
135
136
    /**
137
     * @return \Cubiche\Core\Selector\SelectorInterface
138
     */
139
    public function selector()
140
    {
141
        return $this->selector;
142
    }
143
144
    /**
145
     * @return \Cubiche\Core\Selector\Selectors
146
     */
147
    public static function false()
148
    {
149
        return self::value(false);
150
    }
151
152
    /**
153
     * @return \Cubiche\Core\Selector\Selectors
154
     */
155
    public static function true()
156
    {
157
        return self::value(true);
158
    }
159
160
    /**
161
     * @return \Cubiche\Core\Selector\Selectors
162
     */
163
    public static function null()
164
    {
165
        return self::value(null);
166
    }
167
}
168