Issues (116)

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/Zicht/Itertools/reductions.php (1 issue)

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
 * @copyright Zicht Online <http://zicht.nl>
4
 */
5
6
namespace Zicht\Itertools\reductions;
7
8
use Zicht\Itertools\lib\ChainIterator;
9
use Zicht\Itertools\util\Reductions;
10
11
/**
12
 * Returns a closure that adds two numbers together
13
 *
14
 * @return \Closure
15
 * @deprecated Use \Zicht\Itertools\util\Reductions::add(), will be removed in version 3.0
16
 */
17
function add()
18
{
19
    return Reductions::add();
20
}
21
22
/**
23
 * Returns a closure that subtracts one number from another
24
 *
25
 * @return \Closure
26
 * @deprecated Use \Zicht\Itertools\util\Reductions::sub(), will be removed in version 3.0
27
 */
28
function sub()
29
{
30
    return Reductions::sub();
31
}
32
33
/**
34
 * Returns a closure that multiplies two numbers
35
 *
36
 * @return \Closure
37
 * @deprecated Use \Zicht\Itertools\util\Reductions::mul(), will be removed in version 3.0
38
 */
39
function mul()
40
{
41
    return Reductions::mul();
42
}
43
44
/**
45
 * Returns a closure that returns the smallest of two numbers
46
 *
47
 * @return \Closure
48
 * @deprecated Use \Zicht\Itertools\util\Reductions::min(), will be removed in version 3.0
49
 */
50
function min()
51
{
52
    return Reductions::min();
53
}
54
55
/**
56
 * Returns a closure that returns the largest of two numbers
57
 *
58
 * @return \Closure
59
 * @deprecated Use \Zicht\Itertools\util\Reductions::max(), will be removed in version 3.0
60
 */
61
function max()
62
{
63
    return Reductions::max();
64
}
65
66
/**
67
 * Returns a closure that concatenates two strings using $glue
68
 *
69
 * @param string $glue
70
 * @return \Closure
71
 * @deprecated Use \Zicht\Itertools\util\Reductions::join($glue), will be removed in version 3.0
72
 */
73
function join($glue = '')
74
{
75
    return Reductions::join($glue);
76
}
77
78
/**
79
 * Returns a closure that chains lists together
80
 *
81
 * > $lists = [[1, 2, 3], [4, 5, 6]]
82
 * > iterable($lists)->reduce(reductions\chain(), new ChainIterator())
83
 * results in a ChainIterator: 1, 2, 3, 4, 5, 6
84
 *
85
 * @return \Closure
86
 * @deprecated Use iterable($lists)->collapse(), will be removed in version 3.0
87
 */
88
function chain()
89
{
90
    return function ($chainIterator, $b) {
91
        if (!($chainIterator instanceof ChainIterator)) {
92
            throw new \InvalidArgumentException('Argument $A must be a ChainIterator.  Did your call "reduce" with "new ChainIterator()" as the initial parameter?');
93
        }
94
95
        $chainIterator->extend($b);
96
        return $chainIterator;
97
    };
98
}
99
100
/**
101
 * Returns a reduction closure
102
 *
103
 * @param string $name
104
 * @return \Closure
105
 * @throws \InvalidArgumentException
106
 * @deprecated please use the reduction functions directly, will be removed in version 3.0
107
 */
108
function get_reduction($name)
109
{
110
    if (is_string($name)) {
111
        switch ($name) {
112
            case 'add':
113
                return add();
114
            case 'sub':
115
                return sub();
116
            case 'mul':
117
                return mul();
118
            case 'min':
119
                return min();
120
            case 'max':
121
                return max();
122
            case 'join':
123
                return call_user_func_array('\Zicht\Itertools\reductions\join', array_slice(func_get_args(), 1));
124
            case 'chain':
125
                return chain();
126
        }
127
    }
128
129
    throw new \InvalidArgumentException(sprintf('$NAME "%s" is not a valid reduction.', $name));
130
}
131
132
/**
133
 * Returns a reduction closure
134
 *
135
 * @param mixed $name
136
 * @return \Closure
137
 * @throws \InvalidArgumentException
138
 * @deprecated please use the reduction functions directly, will be removed in version 3.0
139
 */
140
function getReduction($name) // phpcs:ignore Zicht.NamingConventions.Functions.GlobalNaming
0 ignored issues
show
The parameter $name is not used and could be removed.

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

Loading history...
141
{
142
    return call_user_func_array('\Zicht\Itertools\reductions\get_reduction', func_get_args());
143
}
144