Issues (2)

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/UK/DynamicProperties/ExplicitGetter.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
 * @author         UniKado <[email protected]>
4
 * @copyright  (c) 2016, UniKado
5
 * @package        UK\DynamicProperties
6
 * @since          2016-04-01
7
 * @version        0.2.0
8
 */
9
10
11
declare( strict_types = 1 );
12
13
14
namespace UK\DynamicProperties;
15
16
17
/**
18
 * If you extend you're class from this class, you're class becomes an automatic working magic __get method for
19
 * read access the return values of all available getXyz methods by dynamic properties.
20
 *
21
 * For example: If you're class defines the two public get methods 'getFoo()' and 'getFooBar()' you can also
22
 * access the resulting return values with the dynamic properties $instance->foo and $instance->fooBar.
23
 *
24
 * But do'nt forget to document you're dyn. class properties with the @ property-read annotation
25
 *
26
 * @since v0.1.0-dev (Tata43)
27
 */
28
abstract class ExplicitGetter
29
{
30
31
32
   // <editor-fold desc="// = = = =   P R O T E C T E D   F I E L D S   = = = = = = = = = = = = = = = = = = = = = = =">
33
34
   /**
35
    * The names of all get* methods (without the leading get) that should not be mapped as dynamic properties
36
    *
37
    * @type  array
38
    * @since v0.2.0
39
    */
40
   protected $ignoreGetProperties = [];
41
42
   // </editor-fold>
43
44
45
   // <editor-fold desc="// = = = =   P U B L I C   M E T H O D S   = = = = = = = = = = = = = = = = = = = = = = = = =">
46
47
   /**
48
    * The magic get method to let you access all getter methods by dynamic properties.
49
    *
50
    * @param  string $name The name of the required dynamic property.
51
    * @return mixed
52
    * @throws \LogicException If the property is unknown
53
    */
54 14
   public function __get( string $name )
55
   {
56
57 14
      return $this->__internalGet( $name );
58
59
   }
60
61
   /**
62
    * Magic isset implementation.
63
    *
64
    * @param  string $name The name of the required property.
65
    * @return boolean
66
    */
67 6
   public function __isset( string $name )
68
   {
69
70 6
      return $this->hasReadableProperty( $name, $getterName );
71
72
   }
73
74
   /**
75
    * Returns, if a property with the defined name exists for read access.
76
    *
77
    * @param  string $name       The name of the property.
78
    * @param  string $getterName Returns the name of the associated get method, if method returns TRUE.
79
    * @return boolean
80
    */
81 7 View Code Duplication
   public function hasReadableProperty( string $name, &$getterName ) : bool
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
82
   {
83
84 7
      if ( \in_array( $name, $this->ignoreGetProperties ) )
85
      {
86 1
         return false;
87
      }
88
89 6
      $getterName = 'get' . \ucfirst( $name );
90
91 6
      return \method_exists( $this, $getterName );
92
93
   }
94
95
   // </editor-fold>
96
97
98
   // <editor-fold desc="// = = = =   P R O T E C T E D   M E T H O D S   = = = = = = = = = = = = = = = = = = = = = =">
99
100
   /**
101
    * @param string $name
102
    * @return mixed
103
    */
104 14
   protected function __internalGet( string $name )
105
   {
106
107
      // The name of the required getMethod
108 14
      if ( ! $this->hasReadableProperty( $name, $getterName ) )
109
      {
110 2
         throw new \LogicException( 'No such property: ' . __CLASS__ . '::$' . $name. '!' );
111
      }
112
113 12
      return $this->$getterName();
114
115
   }
116
117
   // </editor-fold>
118
119
120
}
121
122