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 (70)

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.

Source/Parsing/FunctionReflection.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
namespace Pinq\Parsing;
4
5
/**
6
 * Implementation of the function reflection interface.
7
 *
8
 * @author Elliot Levin <[email protected]>
9
 */
10
class FunctionReflection extends LocatedFunction implements IFunctionReflection
11
{
12
    /**
13
     * @var callable
14
     */
15
    protected $callable;
16
17
    /**
18
     * @var \ReflectionFunctionAbstract
19
     */
20
    protected $innerReflection;
21
22
    /**
23
     * @var IFunctionScope
24
     */
25
    protected $scope;
26
27
    /**
28
     * @var string
29
     */
30
    protected $globalHash;
31
32
    public function __construct(
33
            callable $callable,
34
            \ReflectionFunctionAbstract $innerReflection,
35
            IFunctionSignature $signature,
36
            IFunctionLocation $location,
37
            IFunctionScope $scope
38
    ) {
39
        parent::__construct($signature, $location);
40
        $this->callable        = $callable;
41
        $this->innerReflection = $innerReflection;
42
        $this->scope           = $scope;
43
44
        //Hashes the signature and location along with the scoped class type due to the
45
        //resolution of scoped class constants (self::, static::, parent::).
46
        //These should be fully qualified in the expression tree hence requiring
47
        //a different hash.
48
        $this->globalHash = md5(
49
                implode(
50
                        '!',
51
                        [
52
                                $this->scope->getThisType(),
53
                                $this->locationAndSignatureHash,
54
                        ]
55
                )
56
        );
57
    }
58
59
    /**
60
     * Creates a new function reflection instance from the supplied callable.
61
     *
62
     * @param callable $callable
63
     *
64
     * @return self
65
     */
66
    public static function fromCallable(callable $callable)
67
    {
68
        $reflection = Reflection::fromCallable($callable);
69
70
        return new self(
71
                $callable,
72
                $reflection,
73
                FunctionSignature::fromReflection($reflection),
74
                FunctionLocation::fromReflection($reflection),
75
                FunctionScope::fromReflection($reflection, $callable));
76
    }
77
78
    public function resolveMagic(IFunctionDeclaration $declaration)
79
    {
80
        $magicConstants = $this->resolveMagicConstants($declaration);
81
        $magicScopes    = $this->resolveMagicScopes($declaration);
82
83
        return new FunctionMagic($magicConstants, $magicScopes);
84
    }
85
86
    private function resolveMagicConstants(IFunctionDeclaration $declaration)
87
    {
88
        $reflection      = $this->innerReflection;
89
        $__FILE__        = $this->location->getFilePath();
90
        $__DIR__         = dirname($__FILE__);
91
        $__NAMESPACE__   = $declaration->getNamespace() ?: '';
92
        $__TRAIT__       = '';
93
        $namespacePrefix = $__NAMESPACE__ === '' ? '' : $__NAMESPACE__ . '\\';
94
95
        if ($declaration->isWithinClass()) {
96
            $__CLASS__       = $namespacePrefix . $declaration->getClass();
97
            $declarationType = $__CLASS__;
98
        } elseif ($declaration->isWithinTrait()) {
99
            $__TRAIT__       = $namespacePrefix . $declaration->getTrait();
100
            $declarationType = $__TRAIT__;
101
102
            //If the function is method declared within a trait the __CLASS__ constant
103
            //is programmed to be the class in which the trait is used in: https://bugs.php.net/bug.php?id=55214&edit=1
104
            //ReflectionMethod::getDeclaringClass() will resolve this.
105
            if ($reflection instanceof \ReflectionMethod) {
106
                $__CLASS__ = $reflection->getDeclaringClass()->getName();
0 ignored issues
show
Consider using $reflection->class. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
107
            }
108
            //Else the function must be a closure declared in a trait, __CLASS__ will resolve to
109
            //the scoped class e.g. get_called_class().
110
            else {
111
                $__CLASS__ = $this->scope->getScopeType() ?: '';
112
            }
113
        } else {
114
            $__CLASS__       = '';
115
            $__TRAIT__       = '';
116
            $declarationType = null;
117
        }
118
119
        $__FUNCTION__              = $reflection->getName();
120
        $__FUNCTION__WithinClosure = $namespacePrefix . '{closure}';
121
        if ($declarationType === null) {
122
            $__METHOD__              = $__FUNCTION__;
123
            $__METHOD__WithinClosure = $__FUNCTION__WithinClosure;
124
        } //__METHOD__ always uses declaration type
125
        else {
126
            $__METHOD__              = $declarationType . '::' . $__FUNCTION__;
127
            $__METHOD__WithinClosure = $declarationType . '::' . $__FUNCTION__WithinClosure;
128
        }
129
130
        return new MagicConstants(
131
                $__DIR__,
132
                $__FILE__,
133
                $__NAMESPACE__,
134
                $__CLASS__,
135
                $__TRAIT__,
136
                $__FUNCTION__,
137
                $__FUNCTION__WithinClosure,
138
                $__METHOD__,
139
                $__METHOD__WithinClosure);
140
    }
141
142
    private function resolveMagicScopes(IFunctionDeclaration $declaration)
143
    {
144
        $selfType        = $this->scope->getScopeType();
145
        $declarationType = $declaration->getClass() ?: $declaration->getTrait();
146
        $selfConstant    = $declarationType !== null ?
147
                ($declaration->getNamespace() !== null ? $declaration->getNamespace() . '\\' : '') . $declarationType : null;
148
        $staticType      = $this->scope->hasThis() ? $this->scope->getThisType() : $selfType;
149
        $staticConstant  = $staticType;
150
        $parentType      = get_parent_class($selfType) ?: null;
151
        $parentConstant  = $parentType;
152
153
        return new MagicScopes(
154
                $this->fullyQualify($selfType),     //self::
155
                $selfConstant,                      //self::class
156
                $this->fullyQualify($staticType),   //static::
157
                $staticConstant,                    //static::class
158
                $this->fullyQualify($parentType),   //parent::
159
                $parentConstant);                   //parent::class
160
    }
161
162
    protected function fullyQualify($type)
163
    {
164
        return $type[0] !== '\\' ? '\\' . $type : $type;
165
    }
166
167
    public function getCallable()
168
    {
169
        return $this->callable;
170
    }
171
172
    public function getInnerReflection()
173
    {
174
        return $this->innerReflection;
175
    }
176
177
    public function getScope()
178
    {
179
        return $this->scope;
180
    }
181
182
    public function getGlobalHash()
183
    {
184
        return $this->globalHash;
185
    }
186
187
    public function asEvaluationContext(array $variableTable = [])
188
    {
189
        return $this->scope->asEvaluationContext($variableTable, $this->location->getNamespace());
190
    }
191
}
192