Issues (64)

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.

tests/VultrTest.php (15 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
 *   This file is part of the Vultr PHP library.
4
 *
5
 *   (c) Albert Leitato <[email protected]>
6
 *
7
 *   For the full copyright and license information, please view the LICENSE
8
 *   file that was distributed with this source code.
9
 */
10
namespace Vultr\Tests;
11
12
class VultrTest extends TestCase
13
{
14
    /**
15
     * @covers \Vultr\Vultr::__get
16
     * @covers \Vultr\Vultr::getClass
17
     * @covers \Vultr\Vultr::__construct
18
     * @covers \Vultr\Support\Str::studly
19
     * @covers \Vultr\Api\AbstractApi::__construct
20
     */
21
    public function testAccount()
22
    {
23
        $account = $this->vultr->account;
0 ignored issues
show
The property account does not seem to exist in Vultr\Vultr.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
24
        $this->assertInstanceOf('Vultr\Api\Account', $account);
25
    }
26
    /**
27
     * @covers \Vultr\Vultr::__get
28
     * @covers \Vultr\Vultr::getClass
29
     * @covers \Vultr\Vultr::__construct
30
     * @covers \Vultr\Support\Str::studly
31
     * @covers \Vultr\Api\AbstractApi::__construct
32
     */
33
    public function testApplication()
34
    {
35
        $application = $this->vultr->application;
0 ignored issues
show
The property application does not seem to exist in Vultr\Vultr.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
36
        $this->assertInstanceOf('Vultr\Api\Application', $application);
37
    }
38
    /**
39
     * @covers \Vultr\Vultr::__get
40
     * @covers \Vultr\Vultr::getClass
41
     * @covers \Vultr\Vultr::__construct
42
     * @covers \Vultr\Support\Str::studly
43
     * @covers \Vultr\Api\AbstractApi::__construct
44
     */
45
    public function testAuth()
46
    {
47
        $this->assertInstanceOf('Vultr\Api\Auth', $this->vultr->auth);
0 ignored issues
show
The property auth does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
48
    }
49
    /**
50
     * @covers \Vultr\Vultr::__get
51
     * @covers \Vultr\Vultr::getClass
52
     * @covers \Vultr\Vultr::__construct
53
     * @covers \Vultr\Support\Str::studly
54
     * @covers \Vultr\Api\AbstractApi::__construct
55
     */
56
    public function testBackup()
57
    {
58
        $this->assertInstanceOf('Vultr\Api\Backup', $this->vultr->backup);
0 ignored issues
show
The property backup does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
59
    }
60
    /**
61
     * @covers \Vultr\Vultr::__get
62
     * @covers \Vultr\Vultr::getClass
63
     * @covers \Vultr\Vultr::__construct
64
     * @covers \Vultr\Support\Str::studly
65
     * @covers \Vultr\Api\AbstractApi::__construct
66
     */
67
    public function testDomain()
68
    {
69
        $this->assertInstanceOf('Vultr\Api\Domain', $this->vultr->domain);
0 ignored issues
show
The property domain does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
70
    }
71
    /**
72
     * @covers \Vultr\Vultr::__get
73
     * @covers \Vultr\Vultr::getClass
74
     * @covers \Vultr\Vultr::__construct
75
     * @covers \Vultr\Support\Str::studly
76
     * @covers \Vultr\Api\AbstractApi::__construct
77
     */
78
    public function testBlock()
79
    {
80
        $this->assertInstanceOf('Vultr\Api\Block', $this->vultr->block);
0 ignored issues
show
The property block does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
81
    }
82
83
    /**
84
     * @covers \Vultr\Vultr::__get
85
     * @covers \Vultr\Vultr::getClass
86
     * @covers \Vultr\Vultr::__construct
87
     * @covers \Vultr\Support\Str::studly
88
     * @covers \Vultr\Api\AbstractApi::__construct
89
     */
90
    public function testDomainRecord()
91
    {
92
        $this->assertInstanceOf('Vultr\Api\DomainRecord', $this->vultr->domain_record);
0 ignored issues
show
The property domain_record does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
93
    }
94
95
    /**
96
     * @covers \Vultr\Vultr::__get
97
     * @covers \Vultr\Vultr::getClass
98
     * @covers \Vultr\Vultr::__construct
99
     * @covers \Vultr\Support\Str::studly
100
     * @covers \Vultr\Api\AbstractApi::__construct
101
     */
102
    public function testFirewallGroup()
103
    {
104
        $this->assertInstanceOf('Vultr\Api\FirewallGroup', $this->vultr->firewall_group);
0 ignored issues
show
The property firewall_group does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
105
    }
106
107
    /**
108
     * @covers \Vultr\Vultr::__get
109
     * @covers \Vultr\Vultr::getClass
110
     * @covers \Vultr\Vultr::__construct
111
     * @covers \Vultr\Support\Str::studly
112
     * @covers \Vultr\Api\AbstractApi::__construct
113
     */
114
    public function testFirewallRule()
115
    {
116
        $this->assertInstanceOf('Vultr\Api\FirewallRule', $this->vultr->firewall_rule);
0 ignored issues
show
The property firewall_rule does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
117
    }
118
119
    /**
120
     * @covers \Vultr\Vultr::__get
121
     * @covers \Vultr\Vultr::getClass
122
     * @covers \Vultr\Vultr::__construct
123
     * @covers \Vultr\Support\Str::studly
124
     * @covers \Vultr\Api\AbstractApi::__construct
125
     */
126
    public function testImage()
127
    {
128
        $this->assertInstanceOf('Vultr\Api\Image', $this->vultr->image);
0 ignored issues
show
The property image does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
129
    }
130
131
    /**
132
     * @covers \Vultr\Vultr::__get
133
     * @covers \Vultr\Vultr::getClass
134
     * @covers \Vultr\Vultr::__construct
135
     * @covers \Vultr\Support\Str::studly
136
     * @covers \Vultr\Api\AbstractApi::__construct
137
     */
138
    public function testOs()
139
    {
140
        $this->assertInstanceOf('Vultr\Api\Os', $this->vultr->os);
0 ignored issues
show
The property os does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
141
    }
142
143
    /**
144
     * @covers \Vultr\Vultr::__get
145
     * @covers \Vultr\Vultr::getClass
146
     * @covers \Vultr\Vultr::__construct
147
     * @covers \Vultr\Support\Str::studly
148
     * @covers \Vultr\Api\AbstractApi::__construct
149
     */
150
    public function testPlan()
151
    {
152
        $this->assertInstanceOf('Vultr\Api\Plan', $this->vultr->plan);
0 ignored issues
show
The property plan does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
153
    }
154
155
    /**
156
     * @covers \Vultr\Vultr::__get
157
     * @covers \Vultr\Vultr::getClass
158
     * @covers \Vultr\Vultr::__construct
159
     * @covers \Vultr\Support\Str::studly
160
     * @covers \Vultr\Api\AbstractApi::__construct
161
     */
162
    public function testRegion()
163
    {
164
        $this->assertInstanceOf('Vultr\Api\Region', $this->vultr->region);
0 ignored issues
show
The property region does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
165
    }
166
167
    /**
168
     * @covers \Vultr\Vultr::__get
169
     * @covers \Vultr\Vultr::getClass
170
     * @covers \Vultr\Vultr::__construct
171
     * @covers \Vultr\Support\Str::studly
172
     * @covers \Vultr\Api\AbstractApi::__construct
173
     */
174
    public function testReservedIp()
175
    {
176
        $this->assertInstanceOf('Vultr\Api\ReservedIp', $this->vultr->reserved_ip);
0 ignored issues
show
The property reserved_ip does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
177
    }
178
179
    /**
180
     * @covers \Vultr\Vultr::__get
181
     * @covers \Vultr\Vultr::getClass
182
     * @covers \Vultr\Vultr::__construct
183
     * @covers \Vultr\Support\Str::studly
184
     * @covers \Vultr\Api\AbstractApi::__construct
185
     */
186
    public function testServer()
187
    {
188
        $this->assertInstanceOf('Vultr\Api\Server', $this->vultr->server);
0 ignored issues
show
The property server does not exist on object<Vultr\Vultr>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
189
    }
190
}
191