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 (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.

src/Annotation/AnnotationsCollection.php (2 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
namespace Wingu\OctopusCore\Reflection\Annotation;
4
5
/**
6
 * A collection of parsed types.
7
 */
8
class AnnotationsCollection
9
{
10
11
    /**
12
     * The parsed annotations definitions.
13
     *
14
     * @var \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition[]
15
     */
16
    protected $annotationsDefinitions = array();
17
18
    /**
19
     * The annotation tags mapper.
20
     *
21
     * @var \Wingu\OctopusCore\Reflection\Annotation\TagMapper
22
     */
23
    protected $tagsMapper;
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param string $comment The comment string from which to extract the annotations.
29
     */
30 129
    public function __construct($comment)
31
    {
32 129
        $parser = new Parser($comment);
33 129
        $this->annotationsDefinitions = $parser->getFoundAnnotationDefinitions();
34 129
    }
35
36
    /**
37
     * Set the annotation tag mapper.
38
     *
39
     * @param \Wingu\OctopusCore\Reflection\Annotation\TagMapper $tm The tag mapper to set.
40
     * @return \Wingu\OctopusCore\Reflection\Annotation\AnnotationsCollection
41
     */
42 15
    public function setTagMapper(TagMapper $tm)
43
    {
44 15
        $this->tagsMapper = $tm;
45
46 15
        return $this;
47
    }
48
49
    /**
50
     * Get the annotation mapper.
51
     *
52
     * @return \Wingu\OctopusCore\Reflection\Annotation\TagMapper
53
     */
54 3
    public function getTagMapper()
55
    {
56 3
        return $this->tagsMapper;
57
    }
58
59
    /**
60
     * Check if the collection contains an annotation tag.
61
     *
62
     * @param string $tag The annotation tag name to check.
63
     * @return boolean
64
     */
65 36
    public function hasAnnotationTag($tag)
66
    {
67 36
        return isset($this->annotationsDefinitions[$tag]);
68
    }
69
70
    /**
71
     * Get all annotations.
72
     *
73
     * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[]
74
     */
75 42
    public function getAnnotations()
76
    {
77 42
        $result = array();
78 42
        foreach ($this->annotationsDefinitions as $annotationDefinition) {
79 12
            $result = array_merge($result, $this->buildAnnotationsInstances($annotationDefinition));
0 ignored issues
show
$annotationDefinition is of type object<Wingu\OctopusCore...n\AnnotationDefinition>, but the function expects a array<integer,object<Win...\AnnotationDefinition>>.

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...
80 14
        }
81
82 42
        return $result;
83
    }
84
85
    /**
86
     * Get an annotation.
87
     *
88
     * @param string $tag The annotation tag name.
89
     * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[]
90
     * @throws \Wingu\OctopusCore\Reflection\Annotation\Exceptions\OutOfBoundsException If there are no annotations with the specified tag.
91
     */
92 21
    public function getAnnotation($tag)
93
    {
94 21
        if ($this->hasAnnotationTag($tag) === true) {
95 18
            $result = array();
96 18
            foreach ($this->annotationsDefinitions[$tag] as $annotationDefinition) {
0 ignored issues
show
The expression $this->annotationsDefinitions[$tag] of type object<Wingu\OctopusCore...n\AnnotationDefinition> is not traversable.
Loading history...
97 18
                $result[] = $this->buildAnnotationInstance($annotationDefinition);
98 6
            }
99
100 18
            return $result;
101
        } else {
102 3
            throw new Exceptions\OutOfBoundsException('No annotations with the tag "' . $tag . '" were found.');
103
        }
104 1
    }
105
106
    /**
107
     * Get the annotation class to use for an annotation tag.
108
     *
109
     * @param string $tag The annotation tag name.
110
     * @return string
111
     */
112 54
    protected function getAnnotationClass($tag)
113
    {
114 54
        if ($this->tagsMapper !== null && $this->tagsMapper->hasMappedTag($tag) === true) {
115 12
            return $this->tagsMapper->getMappedTag($tag);
116 42
        } elseif (class_exists(__NAMESPACE__ . '\Tags\\' . ucfirst($tag) . 'Tag') === true) {
117 9
            return __NAMESPACE__ . '\Tags\\' . ucfirst($tag) . 'Tag';
118
        } else {
119 33
            return __NAMESPACE__ . '\Tags\BaseTag';
120
        }
121
    }
122
123
    /**
124
     * Build all the annotation instances for an annotation tag.
125
     *
126
     * @param \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition[] $annotationDefinitions The annotation tag name.
127
     * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface[]
128
     */
129 12
    protected function buildAnnotationsInstances(array $annotationDefinitions)
130
    {
131 12
        $result = array();
132 12
        foreach ($annotationDefinitions as $annotationDefinition) {
133 12
            $result[] = $this->buildAnnotationInstance($annotationDefinition);
134 4
        }
135
136 12
        return $result;
137
    }
138
139
    /**
140
     * Build an annotation.
141
     *
142
     * @param \Wingu\OctopusCore\Reflection\Annotation\AnnotationDefinition $annotationDefinition The annotation definition.
143
     * @return \Wingu\OctopusCore\Reflection\Annotation\Tags\TagInterface
144
     */
145 30
    protected function buildAnnotationInstance(AnnotationDefinition $annotationDefinition)
146
    {
147 30
        $class = $this->getAnnotationClass($annotationDefinition->getTag());
148 30
        $annotation = new $class($annotationDefinition);
149
150 30
        return $annotation;
151
    }
152
}
153