Issues (2)

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/Dsl.php (1 issue)

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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 10 and the first side effect is on line 161.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
use Peridot\Runner\Context;
3
4
/**
5
 * Creates a suite and sets it on the suite factory
6
 *
7
 * @param string $description
8
 * @param callable $fn
9
 */
10
function describe($description, callable $fn)
11
{
12
    Context::getInstance()->addSuite($description, $fn);
13
}
14
15
/**
16
 * Identical to describe. Useful for test readability
17
 *
18
 * @param $description
19
 * @param callable $fn
20
 */
21
function context($description, callable $fn)
22
{
23
    describe($description, $fn);
24
}
25
26
/**
27
 * Create a spec and add it to the current suite
28
 *
29
 * @param $description
30
 * @param $fn
31
 */
32
function it($description, callable $fn = null)
33
{
34
    Context::getInstance()->addTest($description, $fn);
35
}
36
37
/**
38
 * Identical to it. Useful for test readability
39
 *
40
 * @param $description
41
 * @param $fn
42
 */
43
function test($description, callable $fn = null)
44
{
45
    it($description, $fn);
46
}
47
48
/**
49
 * Create a pending suite
50
 *
51
 * @param $description
52
 * @param callable $fn
53
 */
54
function xdescribe($description, callable $fn)
55
{
56
    Context::getInstance()->addSuite($description, $fn, true);
57
}
58
59
/**
60
 * Create a pending context
61
 *
62
 * @param $description
63
 * @param callable $fn
64
 */
65
function xcontext($description, callable $fn)
66
{
67
    Context::getInstance()->addSuite($description, $fn, true);
68
}
69
70
/**
71
 * Create a pending spec
72
 *
73
 * @param $description
74
 * @param callable $fn
75
 */
76
function xit($description, callable $fn = null)
77
{
78
    Context::getInstance()->addTest($description, $fn, true);
79
}
80
81
/**
82
 * Create a pending spec
83
 *
84
 * @param $description
85
 * @param callable $fn
86
 */
87
function xtest($description, callable $fn = null)
88
{
89
    xit($description, $fn);
90
}
91
92
/**
93
 * Create a focused suite
94
 *
95
 * @param $description
96
 * @param callable $fn
97
 */
98
function fdescribe($description, callable $fn)
99
{
100
    Context::getInstance()->addSuite($description, $fn, null, true);
101
}
102
103
/**
104
 * Create a focused context
105
 *
106
 * @param $description
107
 * @param callable $fn
108
 */
109
function fcontext($description, callable $fn)
110
{
111
    Context::getInstance()->addSuite($description, $fn, null, true);
112
}
113
114
/**
115
 * Create a focused spec
116
 *
117
 * @param $description
118
 * @param callable $fn
119
 */
120
function fit($description, callable $fn = null)
121
{
122
    Context::getInstance()->addTest($description, $fn, null, true);
123
}
124
125
/**
126
 * Create a focused spec
127
 *
128
 * @param $description
129
 * @param callable $fn
130
 */
131
function ftest($description, callable $fn = null)
132
{
133
    fit($description, $fn);
134
}
135
136
/**
137
 * Add a setup function for all specs in the
138
 * current suite
139
 *
140
 * @param callable $fn
141
 */
142
function beforeEach(callable $fn)
143
{
144
    Context::getInstance()->addSetupFunction($fn);
145
}
146
147
/**
148
 * Add a tear down function for all specs in the
149
 * current suite
150
 *
151
 * @param callable $fn
152
 */
153
function afterEach(callable $fn)
154
{
155
    Context::getInstance()->addTearDownFunction($fn);
156
}
157
158
/**
159
 * Change default assert behavior to throw exceptions
160
 */
161
assert_options(ASSERT_WARNING, false);
162
assert_options(ASSERT_CALLBACK, ['Peridot\AssertException', 'handle']);
163