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

Security Analysis    not enabled

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.

SnappyRouterTests/Di/ServiceProviderTest.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 Vectorface\SnappyRouterTests\Di;
4
5
use PHPUnit\Framework\TestCase;
6
use Vectorface\SnappyRouter\Di\ServiceProvider;
7
8
/**
9
 * Tests the ServiceProvider class.
10
 * @copyright Copyright (c) 2014, VectorFace, Inc.
11
 * @author Dan Bruce <[email protected]>
12
 */
13
class ServiceProviderTest extends TestCase
14
{
15
    /**
16
     * An overview of how to use the ServiceProvider class.
17
     * @test
18
     */
19
    public function synopsis()
20
    {
21
        // instantiate the class
22
        $config = array(
23
            'TestController' => 'Vectorface\SnappyRouterTests\Controller\TestDummyController'
24
        );
25
        $serviceProvider = new ServiceProvider($config);
26
27
        // public setters (object chaining)
28
        $services = array_merge(
29
            $config,
30
            array(
31
                'AnotherService' => '/path/to/anotherService.php',
32
                'AnotherServiceForFileClass' => null
33
            )
34
        );
35
36
        $serviceProvider->setService('AnotherService', '/path/to/anotherService.php');
37
        $serviceProvider->setService(
38
            'AnotherServiceForFileClass',
39
            array(
40
                'file' => 'tests/Vectorface/SnappyRouterTests/Controller/NonNamespacedController.php',
41
                'class' => 'NonNamespacedController',
42
            )
43
        );
44
45
        // public getters
46
        $this->assertEquals(
47
            array_keys($services),
48
            $serviceProvider->getServices()
49
        );
50
        $this->assertEquals(
51
            '/path/to/anotherService.php',
52
            $serviceProvider->getService('AnotherService')
53
        );
54
55
        $this->assertInstanceOf(
56
            'Vectorface\SnappyRouterTests\Controller\TestDummyController',
57
            $serviceProvider->getServiceInstance('TestController')
58
        );
59
60
        //Tests instanceCache
61
        $this->assertInstanceOf(
62
            'Vectorface\SnappyRouterTests\Controller\TestDummyController',
63
            $serviceProvider->getServiceInstance('TestController')
64
        );
65
66
        $this->assertInstanceOf(
67
            'NonNamespacedController',
68
            $serviceProvider->getServiceInstance('AnotherServiceForFileClass')
69
        );
70
    }
71
72
    /**
73
     * Test that we can retrieve a non namespaced service.
74
     */
75
    public function testNonNamespacedService()
76
    {
77
        $config = array(
78
            'NonNamespacedController' => 'tests/Vectorface/SnappyRouterTests/Controller/NonNamespacedController.php'
79
        );
80
        $serviceProvider = new ServiceProvider($config);
81
82
        $this->assertInstanceOf(
83
            'NonNamespacedController',
84
            $serviceProvider->getServiceInstance('NonNamespacedController')
85
        );
86
    }
87
88
    /**
89
     * Test that we can retrieve a service while in namespace provisioning mode.
90
     */
91
    public function testNamespaceProvisioning()
92
    {
93
        $serviceProvider = new ServiceProvider(array());
94
        $namespaces = array('Vectorface\SnappyRouterTests\Controller');
95
        $serviceProvider->setNamespaces($namespaces);
96
97
        $this->assertInstanceOf(
98
            'Vectorface\SnappyRouterTests\Controller\TestDummyController',
99
            $serviceProvider->getServiceInstance('TestDummyController')
100
        );
101
    }
102
103
    /**
104
     * Test that we get an exception if we cannot find the service in any
105
     * of the given namespaces.
106
     * @expectedException Exception
107
     * @expectedExceptionMessage Controller class TestDummyController was not found in any listed namespace.
108
     */
109
    public function testNamespaceProvisioningMissingService()
110
    {
111
        $serviceProvider = new ServiceProvider(array());
112
        $serviceProvider->setNamespaces(array());
113
114
        $this->assertInstanceOf(
115
            'Vectorface\SnappyRouterTests\Controller\TestDummyController',
116
            $serviceProvider->getServiceInstance('TestDummyController')
117
        );
118
    }
119
120
    /**
121
     * Test that we can retrieve a service while in folder provisioning mode.
122
     */
123 View Code Duplication
    public function testFolderProvisioning()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
124
    {
125
        $serviceProvider = new ServiceProvider(array());
126
        $folders = array(realpath(__DIR__.'/../'));
127
        $serviceProvider->setFolders($folders);
128
129
        $this->assertInstanceOf(
130
            'NonNamespacedController',
131
            $serviceProvider->getServiceInstance('NonNamespacedController')
132
        );
133
    }
134
135
    /**
136
     * Test that we get an exception if we cannot find the service in any
137
     * of the given folders (recursively checking).
138
     * @expectedException Exception
139
     * @expectedExceptionMessage Controller class NonExistantController not found in any listed folder.
140
     */
141 View Code Duplication
    public function testFolderProvisioningMissingService()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
142
    {
143
        $serviceProvider = new ServiceProvider(array());
144
        $folders = array(realpath(__DIR__.'/../'));
145
        $serviceProvider->setFolders($folders);
146
147
        $serviceProvider->getServiceInstance('NonExistantController');
148
    }
149
}
150