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

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.

Resource/BaseResource.php (1 issue)

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 prgTW\BaseCRM\Resource;
4
5
use Doctrine\Common\Inflector\Inflector;
6
use prgTW\BaseCRM\Exception\ResourceException;
7
8
abstract class BaseResource
9
{
10
	const ENDPOINT_APP    = 'https://app.futuresimple.com';
11
	const ENDPOINT_COMMON = 'https://common.futuresimple.com';
12
	const ENDPOINT_CORE   = 'https://core.futuresimple.com';
13
	const ENDPOINT_CRM    = 'https://crm.futuresimple.com';
14
	const ENDPOINT_LEADS  = 'https://leads.futuresimple.com';
15
	const ENDPOINT_SALES  = 'https://sales.futuresimple.com';
16
	const ENDPOINT_TAGS   = 'https://tags.futuresimple.com';
17
18
	const PREFIX = 'api/v1';
19
20
	/** @var array */
21
	protected $data = null;
22
23
	/**
24
	 * @param string $resourceClassName Fully classified class name
25
	 *
26
	 * @return string
27
	 */
28
	protected function getClassNameOnly($resourceClassName = null)
29
	{
30
		$name = null === $resourceClassName ? static::class : $resourceClassName;
31
		$name = explode('\\', $name);
32
		$name = end($name);
33
34
		return $name;
35
	}
36
37
	/**
38
	 * @param string $resourceClassName Fully classified class name
39
	 *
40
	 * @return string
41
	 */
42
	public function getResourceName($resourceClassName = null)
43
	{
44
		$name = $this->getClassNameOnly($resourceClassName);
45
46
		return Inflector::tableize($name);
47
	}
48
49
	/**
50
	 * @param string $resourceClassName Fully classified class name
51
	 *
52
	 * @return string
53
	 */
54
	protected function getChildResourceName($resourceClassName = null)
55
	{
56
		$resourceName = $this->getResourceName($resourceClassName);
57
		$singular     = Inflector::singularize($resourceName);
58
59
		return $singular;
60
	}
61
62
	/**
63
	 * @param array $data
64
	 */
65
	protected function hydrate(array $data)
66
	{
67
		$this->data = [];
68 View Code Duplication
		foreach ($data as $key => $value)
69
		{
70
			$setter = sprintf('set%s', ucfirst(Inflector::camelize($key)));
71
			if (method_exists($this, $setter))
72
			{
73
				$this->$setter($value);
74
			}
75
			else
76
			{
77
				$this->data[$key] = $value;
78
			}
79
		}
80
81
		$this->postHydrate($data);
82
	}
83
84
	/**
85
	 * @param array $fieldNames
86
	 *
87
	 * @throws ResourceException when dehydration has been stopped
88
	 * @return array
89
	 */
90
	protected function dehydrate(array $fieldNames = [])
91
	{
92
		$result = $this->preDehydrate($fieldNames);
93
		if (false === $result)
94
		{
95
			//@codeCoverageIgnoreStart
96
			throw new ResourceException('Dehydration has been stopped');
97
			//@codeCoverageIgnoreEnd
98
		}
99
100
		if (is_array($result))
101
		{
102
			$fieldNames = $result;
103
		}
104
105
		$data = [];
106
		if ([] === $fieldNames)
107
		{
108
			$data = $this->data;
109
		}
110
		else
111
		{
112 View Code Duplication
			foreach ($fieldNames as $fieldName)
113
			{
114
				$getter           = sprintf('get%s', ucfirst(Inflector::camelize($fieldName)));
115
				$data[$fieldName] = method_exists($this, $getter) ? $this->$getter() : $this->data[$fieldName];
116
			}
117
		}
118
119
		$this->postDehydrate($data);
120
121
		return $data;
122
	}
123
124
	/**
125
	 * @param string $name
126
	 *
127
	 * @return bool
128
	 */
129 View Code Duplication
	public function __isset($name)
130
	{
131
		$issetter = sprintf('isset%s', ucfirst(Inflector::camelize($name)));
132
		if (method_exists($this, $issetter))
133
		{
134
			return $this->$issetter();
135
		}
136
137
		$key = Inflector::tableize($name);
138
		if (array_key_exists($key, $this->data))
139
		{
140
			return true;
141
		}
142
143
		return isset($this->$name);
144
	}
145
146
	/**
147
	 * @param string $name
148
	 *
149
	 * @return mixed
150
	 */
151 View Code Duplication
	public function __get($name)
152
	{
153
		$getter = sprintf('get%s', ucfirst(Inflector::camelize($name)));
154
		if (method_exists($this, $getter))
155
		{
156
			return $this->$getter();
157
		}
158
159
		$key = Inflector::tableize($name);
160
		if (array_key_exists($key, $this->data))
161
		{
162
			return $this->data[$key];
163
		}
164
165
		return $this->$name;
166
	}
167
168
	/**
169
	 * @param string $name
170
	 * @param mixed  $value
171
	 */
172
	public function __set($name, $value)
173
	{
174
		$setter = sprintf('set%s', ucfirst(Inflector::camelize($name)));
175
		if (method_exists($this, $setter))
176
		{
177
			return $this->$setter($value);
178
		}
179
180
		$key              = Inflector::tableize($name);
181
		$this->data[$key] = $value;
182
	}
183
184
	/**
185
	 * @param array $data
186
	 *
187
	 * @codeCoverageIgnore
188
	 */
189
	protected function postHydrate(array $data)
190
	{
191
192
	}
193
194
	/**
195
	 * @param array $fieldNames
196
	 *
197
	 * @return array|bool False: stop dehydration, array: new field names
198
	 *
199
	 * @codeCoverageIgnore
200
	 */
201
	protected function preDehydrate(array $fieldNames)
0 ignored issues
show
The parameter $fieldNames 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...
202
	{
203
204
	}
205
206
	/**
207
	 * @param array $data
208
	 *
209
	 * @codeCoverageIgnore
210
	 */
211
	protected function postDehydrate(array &$data)
212
	{
213
214
	}
215
}
216