GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (57)

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/JonnyW/PhantomJs/Client.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 php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace JonnyW\PhantomJs;
10
11
use JonnyW\PhantomJs\Procedure\ProcedureLoaderInterface;
12
use JonnyW\PhantomJs\Procedure\ProcedureCompilerInterface;
13
use JonnyW\PhantomJs\Http\MessageFactoryInterface;
14
use JonnyW\PhantomJs\Http\RequestInterface;
15
use JonnyW\PhantomJs\Http\ResponseInterface;
16
use JonnyW\PhantomJs\DependencyInjection\ServiceContainer;
17
18
/**
19
 * PHP PhantomJs
20
 *
21
 * @author Jon Wenmoth <[email protected]>
22
 */
23
class Client implements ClientInterface
24
{
25
    /**
26
     * Client.
27
     *
28
     * @var \JonnyW\PhantomJs\ClientInterface
29
     * @access private
30
     */
31
    private static $instance;
32
33
    /**
34
     * PhantomJs engine.
35
     *
36
     * @var \JonnyW\PhantomJs\Engine
37
     * @access protected
38
     */
39
    protected $engine;
40
41
    /**
42
     * Procedure loader.
43
     *
44
     * @var \JonnyW\PhantomJs\Procedure\ProcedureLoaderInterface
45
     * @access protected
46
     */
47
    protected $procedureLoader;
48
49
    /**
50
     * Procedure validator.
51
     *
52
     * @var \JonnyW\PhantomJs\Procedure\ProcedureCompilerInterface
53
     * @access protected
54
     */
55
    protected $procedureCompiler;
56
57
    /**
58
     * Message factory.
59
     *
60
     * @var \JonnyW\PhantomJs\Http\MessageFactoryInterface
61
     * @access protected
62
     */
63
    protected $messageFactory;
64
65
    /**
66
     * Procedure template
67
     *
68
     * @var string
69
     * @access protected
70
     */
71
    protected $procedure;
72
73
    /**
74
     * Internal constructor
75
     *
76
     * @access public
77
     * @param  \JonnyW\PhantomJs\Engine                               $engine
78
     * @param  \JonnyW\PhantomJs\Procedure\ProcedureLoaderInterface   $procedureLoader
79
     * @param  \JonnyW\PhantomJs\Procedure\ProcedureCompilerInterface $procedureCompiler
80
     * @param  \JonnyW\PhantomJs\Http\MessageFactoryInterface         $messageFactory
81
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
82
     */
83 41
    public function __construct(Engine $engine, ProcedureLoaderInterface $procedureLoader, ProcedureCompilerInterface $procedureCompiler, MessageFactoryInterface $messageFactory)
84
    {
85 41
        $this->engine            = $engine;
86 41
        $this->procedureLoader   = $procedureLoader;
87 41
        $this->procedureCompiler = $procedureCompiler;
88 41
        $this->messageFactory    = $messageFactory;
89 41
        $this->procedure         = 'http_default';
90 41
    }
91
92
    /**
93
     * Get singleton instance
94
     *
95
     * @access public
96
     * @return \JonnyW\PhantomJs\Client
97
     */
98 6
    public static function getInstance()
99
    {
100 6
        if (!self::$instance instanceof ClientInterface) {
101
102 1
            $serviceContainer = ServiceContainer::getInstance();
103
104 1
            self::$instance = new static(
105 1
                $serviceContainer->get('engine'),
106 1
                $serviceContainer->get('procedure_loader'),
107 1
                $serviceContainer->get('procedure_compiler'),
108 1
                $serviceContainer->get('message_factory')
109 1
            );
110 1
        }
111
112 6
        return self::$instance;
113
    }
114
115
    /**
116
     * Get PhantomJs engine.
117
     *
118
     * @access public
119
     * @return \JonnyW\PhantomJs\Engine
120
     */
121 13
    public function getEngine()
122
    {
123 13
        return $this->engine;
124
    }
125
126
    /**
127
     * Get message factory instance
128
     *
129
     * @access public
130
     * @return \JonnyW\PhantomJs\Http\MessageFactoryInterface
131
     */
132 38
    public function getMessageFactory()
133
    {
134 38
        return $this->messageFactory;
135
    }
136
137
    /**
138
     * Get procedure loader instance
139
     *
140
     * @access public
141
     * @return \JonnyW\PhantomJs\Procedure\ProcedureLoaderInterface
142
     */
143 9
    public function getProcedureLoader()
144
    {
145 9
        return $this->procedureLoader;
146
    }
147
148
    /**
149
     * Send request
150
     *
151
     * @access public
152
     * @param  \JonnyW\PhantomJs\Http\RequestInterface  $request
153
     * @param  \JonnyW\PhantomJs\Http\ResponseInterface $response
154
     * @return \JonnyW\PhantomJs\Http\ResponseInterface
155
     */
156 37
    public function send(RequestInterface $request, ResponseInterface $response)
157
    {
158 37
        $procedure = $this->procedureLoader->load($this->procedure);
159
160 37
        $this->procedureCompiler->compile($procedure, $request);
0 ignored issues
show
$request is of type object<JonnyW\PhantomJs\Http\RequestInterface>, but the function expects a object<JonnyW\PhantomJs\Procedure\InputInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
161
162 36
        $procedure->run($request, $response);
0 ignored issues
show
$request is of type object<JonnyW\PhantomJs\Http\RequestInterface>, but the function expects a object<JonnyW\PhantomJs\Procedure\InputInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
$response is of type object<JonnyW\PhantomJs\Http\ResponseInterface>, but the function expects a object<JonnyW\PhantomJs\...cedure\OutputInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
163
164 36
        return $response;
165
    }
166
167
    /**
168
     * Get log.
169
     *
170
     * @access public
171
     * @return string
172
     */
173 9
    public function getLog()
174
    {
175 9
        return $this->getEngine()->getLog();
176
    }
177
178
    /**
179
     * Set procedure template.
180
     *
181
     * @access public
182
     * @param  string $procedure
183
     * @return void
184
     */
185 3
    public function setProcedure($procedure)
186
    {
187 3
        $this->procedure = $procedure;
188 3
    }
189
190
    /**
191
     * Get procedure template.
192
     *
193
     * @access public
194
     * @return string
195
     */
196
    public function getProcedure()
197
    {
198
        return $this->procedure;
199
    }
200
201
    /**
202
     * Get procedure compiler.
203
     *
204
     * @access public
205
     * @return \JonnyW\PhantomJs\Procedure\ProcedureCompilerInterface
206
     */
207
    public function getProcedureCompiler()
208
    {
209
        return $this->procedureCompiler;
210
    }
211
212
    /**
213
     * Set lazy request flag.
214
     *
215
     * @access public
216
     * @return void
217
     */
218 2
    public function isLazy()
219
    {
220 2
        $this->procedure = 'http_lazy';
221 2
    }
222
}
223