Issues (74)

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.

src/model/Relationship.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
namespace keeko\tools\model;
3
4
use Propel\Generator\Model\ForeignKey;
5
use Propel\Generator\Model\Table;
6
use keeko\framework\utils\NameUtils;
7
8
abstract class Relationship {
9
10
	const ONE_TO_ONE = 'one-to-one';
11
	const ONE_TO_MANY = 'one-to-many';
12
	const MANY_TO_MANY = 'many-to-many';
13
14
	/** @var Table */
15
	protected $model;
16
17
	/** @var Table */
18
	protected $foreign;
19
20
	/** @var ForeignKey */
21
	protected $fk;
22
23
	/**
24
	 * Returns the type of this relationship
25
	 *
26
	 * @return string
27
	 */
28
	abstract public function getType();
29
30
	public function isOneToOne() {
31
		return $this->getType() == Relationship::ONE_TO_ONE;
0 ignored issues
show
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
32
	}
33
34
	/**
35
	 * Returns the model
36
	 *
37
	 * @return Table
38
	 */
39
	public function getModel() {
40
		return $this->model;
41
	}
42
43
	/**
44
	 * Returns the foreign model
45
	 *
46
	 * @return Table
47
	 */
48
	public function getForeign() {
49
		return $this->foreign;
50
	}
51
52
	/**
53
	 * Returns the foreign key
54
	 *
55
	 * @return ForeignKey
56
	 */
57
	public function getForeignKey() {
58
		return $this->fk;
59
	}
60
61
	/**
62
	 * Returns the related name in studly case
63
	 *
64
	 * @return string
65
	 */
66
	abstract public function getRelatedName();
67
68
	/**
69
	 * Returns the pluralized related name in studly case
70
	 *
71
	 * @return string
72
	 */
73
	public function getRelatedPluralName() {
74
		return NameUtils::pluralize($this->getRelatedName());
75
	}
76
77
	/**
78
	 * Returns the related type name for usage in api environment (slug, type-name, etc)
79
	 *
80
	 * @return string
81
	 */
82
	public function getRelatedTypeName() {
83
		return NameUtils::dasherize($this->getRelatedName());
84
	}
85
86
	/**
87
	 * Returns the pluralized related type name for usage in api environment (slug, type-name, etc)
88
	 *
89
	 * @return string
90
	 */
91
	public function getRelatedPluralTypeName() {
92
		return NameUtils::pluralize($this->getRelatedTypeName());
93
	}
94
95
	/**
96
	 * Returns the reverse related name in studly case
97
	 */
98
	abstract public function getReverseRelatedName();
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
99
100
	/**
101
	 * Returns the pluralized reverse related name in studly case
102
	 *
103
	 * @return string
104
	 */
105
	public function getReverseRelatedPluralName() {
106
		return NameUtils::pluralize($this->getReverseRelatedName());
107
	}
108
109
	/**
110
	 * Returns the reverse related type name for usage in api environment (slug, type-name, etc)
111
	 *
112
	 * @return string
113
	 */
114
	public function getReverseRelatedTypeName() {
115
		return NameUtils::dasherize($this->getReverseRelatedName());
116
	}
117
118
	/**
119
	 * Returns the pluralized reverse related type name for usage in api environment (slug, type-name, etc)
120
	 *
121
	 * @return string
122
	 */
123
	public function getReverseRelatedPluralTypeName() {
124
		return NameUtils::pluralize($this->getReverseRelatedTypeName());
125
	}
126
127
	/**
128
	 * Returns whether the relationship refers to itself
129
	 *
130
	 * @return bool
131
	 */
132
	public function isReflexive() {
133
		return $this->model == $this->foreign;
134
	}
135
}