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

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/Manager/ConfigurationManager.php (13 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 PhpAbac\Manager;
4
5
use PhpAbac\Loader\AbacLoader;
6
use PhpAbac\Loader\JsonAbacLoader;
7
use PhpAbac\Loader\YamlAbacLoader;
8
9
use Symfony\Component\Config\FileLocatorInterface;
10
11
class ConfigurationManager {
12
	/** @var FileLocatorInterface * */
13
	protected $locator;
14
	/** @var AbacLoader[] * */
15
	protected $loaders;
16
	/** @var array * */
17
	protected $rules;
18
	/** @var array * */
19
	protected $attributes;
20
	
21
//	protected $config_path_route;
22
	
23
	/** @var array List of File Already Loader */
24
	protected $config_files_loaded;
25
	
26
	/**
27
	 * @param FileLocatorInterface $locator
28
	 * @param string|array         $format A format or an array of format
29
	 */
30 12
	public function __construct( FileLocatorInterface $locator, $format = [
31
		'yaml',
32
		'json',
33
	] ) {
34 12
		$this->locator             = $locator;
35 12
		$this->attributes          = [];
36 12
		$this->rules               = [];
37 12
		$this->config_files_loaded = [];
38 12
		if ( in_array( 'yaml', $format ) ) {
39 12
			$this->loaders[ 'yaml' ] = new YamlAbacLoader( $locator, $this );
0 ignored issues
show
The call to YamlAbacLoader::__construct() has too many arguments starting with $this.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
40 12
		}
41 12
		if ( in_array( 'json', $format ) ) {
42 12
			$this->loaders[ 'json' ] = new JsonAbacLoader( $locator, $this );
0 ignored issues
show
The call to JsonAbacLoader::__construct() has too many arguments starting with $this.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
43 12
		}
44
		
45 12
	}
46
	
47 4
	public function setConfigPathRoot($configPaths_root = null) {
48
//		$this->config_path_route = $configPaths_root;
49 4
		foreach($this->loaders as $loader) {
0 ignored issues
show
Expected 1 space after FOREACH keyword; 0 found
Loading history...
50 4
			$loader->setCurrentDir($configPaths_root);
51 4
		}
52 4
	}
53
		
54
	/**
55
	 * @param array $configurationFiles
56
	 */
57 12
	public function parseConfigurationFile( $configurationFiles ) {
0 ignored issues
show
Expected 0 spaces between opening bracket and argument "$configurationFiles"; 1 found
Loading history...
Expected 0 spaces between argument "$configurationFiles" and closing bracket; 1 found
Loading history...
58 12
		foreach ( $configurationFiles as $configurationFile ) {
0 ignored issues
show
Space found after opening bracket of FOREACH loop
Loading history...
Space found before closing bracket of FOREACH loop
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
59 12
			$config = $this->getLoader( $configurationFile )->import( $configurationFile, pathinfo( $configurationFile, PATHINFO_EXTENSION ) );
60
			
61 12
			if (in_array($config['path'],$this->config_files_loaded)) {
62
				continue;
63
			}
64
			
65 12
			$this->config_files_loaded[] = $config['path'];
66
			
67 12
			if (isset($config['@import'])) {
68 4
				$this->parseConfigurationFile($config['@import']);
69 4
				unset($config['@import']);
70 4
			}
71
			
72 12
			if ( isset( $config[ 'attributes' ] ) ) {
73 12
				$this->attributes = array_merge( $this->attributes, $config[ 'attributes' ] );
74 12
			}
75 12
			if ( isset( $config[ 'rules' ] ) ) {
76 12
				$this->rules = array_merge( $this->rules, $config[ 'rules' ] );
77 12
			}
78 12
		}
79 12
	}
80
	
81
	
82
	
83
	/**
84
	 * Function to retrieve the good loader for the configuration file
85
	 *
86
	 * @param $configurationFile
87
	 *
88
	 * @return AbacLoader
89
	 *
90
	 * @throws \Exception
91
	 */
92 12
	private function getLoader( $configurationFile ) {
0 ignored issues
show
Expected 0 spaces between opening bracket and argument "$configurationFile"; 1 found
Loading history...
Expected 0 spaces between argument "$configurationFile" and closing bracket; 1 found
Loading history...
93
		
94 12
		foreach ( $this->loaders as $AbacLoader ) {
0 ignored issues
show
Space found after opening bracket of FOREACH loop
Loading history...
Space found before closing bracket of FOREACH loop
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
95 12
			if ( $AbacLoader::supportsExtension( $configurationFile ) ) {
96 12
				return $AbacLoader;
97
			}
98 4
		}
99
		throw new \Exception( 'Loader not found for the file ' . $configurationFile );
100
	}
101
	
102
	/**
103
	 * @return array
104
	 */
105 12
	public function getAttributes() {
106 12
		return $this->attributes;
107
	}
108
	
109
	/**
110
	 * @return array
111
	 */
112 6
	public function getRules() {
113 6
		return $this->rules;
114
	}
115
}