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

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/TwigServiceProvider.php (6 issues)

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
namespace Germania\TwigServiceProvider;
3
4
use Pimple\Container;
5
use Pimple\ServiceProviderInterface;
6
7
use \Twig_Loader_Filesystem;
8
use \Twig_Loader_Array;
9
use \Twig_Loader_Chain;
10
use \Twig_Environment;
11
use \Twig_Extension_Debug;
12
13
14
15
class TwigServiceProvider implements ServiceProviderInterface
16
{
17
18
    public $config = array(
19
        // For Twig Filesystem Loader
20
        // See https://twig.symfony.com/doc/2.x/api.html#twig-loader-filesystem
21
        'templates' => 'templates',
22
23
        // Twig Options
24
        // See https://twig.symfony.com/doc/2.x/api.html#environment-options
25
        'debug' => false,
26
        'cache' => 'cache',
27
        'auto_reload' => true,
28
        'autoescape'  => false,
29
        'strict_variables' => false
30
    );
31
32
33
    /**
34
     * @param array $config Configuration array.
35
     */
36 65
    public function __construct( array $config = array())
37
    {
38 65
        $this->config = array_merge($this->config, $config);
39 65
    }
40
41
42
    /**
43
     * @implements ServiceProviderInterface
44
     */
45 48
    public function register(Container $dic)
46
    {
47
48
        /**
49
         * @return array
50
         */
51 7
        $dic['Twig.Config'] = function( $dic ) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52 35
            return $this->config;
53
        };
54
55
56
        /**
57
         * @return string
58
         */
59 3
        $dic['Twig.CachePath'] = function( $dic ) {
60 15
            $template_config = $dic['Twig.Config'];
61 15
            return $template_config['cache'];
62
        };
63
64
65
        /**
66
         * @return array
67
         */
68 4
        $dic['Twig.TemplatePaths'] = function( $dic ) {
69 20
            $template_config = $dic['Twig.Config'];
70 20
            $templates_paths = $template_config['templates'];
71
72 20
            if (is_string($templates_paths)) {
73 20
                $templates_paths = array( $templates_paths );
74 4
            }
75
76 20
            return $templates_paths;
77
        };
78
79
80
        /**
81
         * @return array
82
         */
83 3
        $dic['Twig.Loaders'] = function( $dic ) {
84 15
            $templates_paths = $dic['Twig.TemplatePaths'];
85
86
            return [
87 15
                new Twig_Loader_Filesystem( $templates_paths )
88 3
            ];
89
        };
90
91
92
93
94
        /**
95
         * @return array
96
         */
97 2
        $dic['Twig.Options'] = function( $dic ) {
98 10
            $template_config = $dic['Twig.Config'];
99 10
            $cache_path      = $dic['Twig.CachePath'];
100
101
            return [
102 10
                'cache'            => $cache_path,
103 10
                'auto_reload'      => $template_config['auto_reload'],
104 10
                'autoescape'       => $template_config['autoescape'],
105 10
                'debug'            => $template_config['debug'],
106 10
                'strict_variables' => $template_config['strict_variables']
107 2
            ];
108
        };
109
110
111
112
        /**
113
         * @return array
114
         */
115 2
        $dic['Twig.Globals'] = function( $dic ) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
116 10
            return array();
117
        };
118
119
120
        /**
121
         * @return array
122
         */
123 2
        $dic['Twig.Filters'] = function( $dic ) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
124 10
            return array();
125
        };
126
127
128
        /**
129
         * @return array
130
         */
131 2
        $dic['Twig.Tests'] = function( $dic ) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
132 10
            return array();
133
        };
134
135
        /**
136
         * @return array
137
         */
138 2
        $dic['Twig.Functions'] = function( $dic ) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
139 10
            return array();
140
        };
141
142
        /**
143
         * @return array
144
         */
145 2
        $dic['Twig.Extensions'] = function($dic) {
0 ignored issues
show
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
146
            return [
147 8
                new Twig_Extension_Debug
148 2
            ];
149
        };
150
151
152
153
154
155
156
        /**
157
         * @return Twig_Loader_Chain
158
         */
159 2
        $dic['Twig.LoaderChain'] = function($dic) {
160 10
            $loaders = $dic['Twig.Loaders'];
161 10
            return new Twig_Loader_Chain( $loaders );
162
        };
163
164
165
        /**
166
         * @return Twig_Environment
167
         */
168 2
        $dic['Twig'] = function( $dic ) {
169
170
            // ---- 1. Instantiate Twig -----
171 5
            $twig_loader_chain = $dic['Twig.LoaderChain'];
172 5
            $twig_options      = $dic['Twig.Options'];
173 5
            $twig = new Twig_Environment($twig_loader_chain, $twig_options);
174
175
176
            // ---- 2. Configure Extras -----
177
178
            // Add Twig_Extensions
179 5
            $extensions = $dic['Twig.Extensions'];
180 5
            foreach( $extensions as $ext ):
181 5
                $twig->addExtension( $ext );
182 1
            endforeach;
183
184
185
            // Add Template Globals for Twig
186 5
            $globals = $dic['Twig.Globals'];
187 5
            foreach( $globals as $name => $value ):
188
                $twig->addGlobal( $name, $value );
189 1
            endforeach;
190
191
192
            // Add Twig_Filters
193 5
            $filters = $dic['Twig.Filters'];
194 5
            foreach( $filters as $filter ):
195
                $twig->addFilter( $filter );
196 1
            endforeach;
197
198
199
            // Add Tests
200 5
            $tests = $dic['Twig.Tests'];
201 5
            foreach( $tests as $test ):
202
                $twig->addTest( $test );
203 1
            endforeach;
204
205
206
            // Add Functions
207 5
            $functions = $dic['Twig.Functions'];
208 5
            foreach( $functions as $fn ):
209
                $twig->addFunction( $fn );
210 1
            endforeach;
211
212
213
            // ---- 3. Return Twig_Environment
214 5
            return $twig;
215
        };
216
217 60
    }
218
}
219
220