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

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/LoggerServiceProvider.php (5 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
namespace Germania\Logger;
3
4
use Pimple\Container;
5
use Pimple\ServiceProviderInterface;
6
7
use Psr\Log\LoggerInterface;
8
use Monolog\Logger as MonologLogger;
9
use Monolog\Processor\WebProcessor;
10
use Monolog\Processor\PsrLogMessageProcessor;
11
12
class LoggerServiceProvider implements ServiceProviderInterface
13
{
14
15
    /**
16
     * @var string
17
     */
18
    public $logger_name  = "Logger";
19
20
    /**
21
     * @var array
22
     */
23
    public $server_data  = array();
24
25
26
    /**
27
     * @param string   $logger_name   App or logger name
28
     * @param array    $server_data   Server data, default is `$_SERVER`
29
     * @param boolean  $anonymize_ip  Whether to anonymize client IPs
30
     */
31 18
    public function __construct(string $logger_name, array $server_data = null, $anonymize_ip = true)
32
    {
33 18
        $this->logger_name  = $logger_name;
34 18
        $this->server_data  = $server_data ?: $_SERVER;
35
36 18
        if ($anonymize_ip and isset($this->server_data['REMOTE_ADDR'])):
37 2
            $this->server_data['REMOTE_ADDR'] = preg_replace('/[0-9]+\z/', 'XXX', $this->server_data['REMOTE_ADDR']);
38
        endif;
39 18
    }
40
41
42
    /**
43
     * @return void
44
     */
45 10
    public function register(Container $dic)
46
    {
47
48
49
        /**
50
         * @return \Monolog\Logger
51
         */
52 10
        $dic[LoggerInterface::class] = function ($dic) {
53 2
            return $dic['Monolog.Psr3Logger'];
54
        };
55
56
57
58
        /**
59
         * @return \Monolog\Logger
60
         */
61 10
        $dic['Logger'] = function ($dic) {
62 2
            return $dic['Monolog.Psr3Logger'];
63
        };
64
65
66
67
        /**
68
         * @return string
69
         */
70 10
        $dic['Logger.name'] = 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...
71 6
            return $this->logger_name;
72
        };
73
74
75
        /**
76
         * @return array
77
         */
78 10
        $dic['Logger.Environment'] = 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...
79 8
            return $this->server_data;
80
        };
81
82
83
        /**
84
         * @return MonologLogger
85
         */
86 10
        $dic['Monolog.Psr3Logger'] = function ($dic) {
87 6
            $handlers   = $dic['Monolog.Handlers'];
88 6
            $processors = $dic['Monolog.Processors'];
89 6
            $title      = $dic['Logger.name'];
90
91 6
            return new MonologLogger($title, $handlers, $processors);
92
        };
93
94
95
        /**
96
         * @return array
97
         */
98 10
        $dic['Monolog.Handlers'] = 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...
99 8
            return array();
100
        };
101
102
103
104
        /**
105
         * @return array
106
         */
107 10
        $dic['Monolog.Processors'] = function ($dic) {
108
            return array(
109 8
                $dic['Monolog.Processors.PsrLogMessages'],
110 8
                $dic['Monolog.Processors.WebProcessor']
111
            );
112
        };
113
114
115
        /**
116
         * @see https://github.com/Seldaek/monolog/blob/master/src/Monolog/Processor/PsrLogMessageProcessor.php
117
         * @return PsrLogMessageProcessor
118
         */
119 10
        $dic['Monolog.Processors.PsrLogMessages'] = 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...
120 8
            return new PsrLogMessageProcessor(null, true);
121
        };
122
123
124
        /**
125
         * @return WebProcessor
126
         */
127 10
        $dic['Monolog.Processors.WebProcessor'] = function ($dic) {
128 8
            $server_data  = $dic['Logger.Environment'];
129 8
            $extra_fields = $dic['Monolog.Processors.WebProcessor.extraFields'];
130 8
            return new WebProcessor($server_data, $extra_fields);
131
        };
132
133
134
        /**
135
         * Choose from url, ip, http_method, server, referrer
136
         *
137
         * @return array
138
         */
139 10
        $dic['Monolog.Processors.WebProcessor.extraFields'] = 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...
140
            return [
141 8
                'http_method',
142
                'url',
143
                'ip'
144
            ];
145
        };
146 10
    }
147
}
148