Issues (318)

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/Factory.php (1 issue)

Labels
Severity

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 SevenShores\Hubspot;
4
5
use SevenShores\Hubspot\Http\Client;
6
7
/**
8
 * Class Factory.
9
 *
10
 * @method \SevenShores\Hubspot\Resources\BlogAuthors blogAuthors()
11
 * @method \SevenShores\Hubspot\Resources\Blogs blogs()
12
 * @method \SevenShores\Hubspot\Resources\BlogPosts blogPosts()
13
 * @method \SevenShores\Hubspot\Resources\BlogTopics blogTopics()
14
 * @method \SevenShores\Hubspot\Resources\Companies companies()
15
 * @method \SevenShores\Hubspot\Resources\CompanyProperties companyProperties()
16
 * @method \SevenShores\Hubspot\Resources\CalendarEvents calendarEvents()
17
 * @method \SevenShores\Hubspot\Resources\ContactLists contactLists()
18
 * @method \SevenShores\Hubspot\Resources\ContactProperties contactProperties()
19
 * @method \SevenShores\Hubspot\Resources\Contacts contacts()
20
 * @method \SevenShores\Hubspot\Resources\CrmAssociations crmAssociations()
21
 * @method \SevenShores\Hubspot\Resources\Email email()
22
 * @method \SevenShores\Hubspot\Resources\EmailEvents emailEvents()
23
 * @method \SevenShores\Hubspot\Resources\Engagements engagements()
24
 * @method \SevenShores\Hubspot\Resources\Files files()
25
 * @method \SevenShores\Hubspot\Resources\Forms forms()
26
 * @method \SevenShores\Hubspot\Resources\HubDB hubDB()
27
 * @method \SevenShores\Hubspot\Resources\Keywords keywords()
28
 * @method \SevenShores\Hubspot\Resources\Pages pages()
29
 * @method \SevenShores\Hubspot\Resources\SocialMedia socialMedia()
30
 * @method \SevenShores\Hubspot\Resources\Tickets tickets()
31
 * @method \SevenShores\Hubspot\Resources\Timeline timeline()
32
 * @method \SevenShores\Hubspot\Resources\Workflows workflows()
33
 * @method \SevenShores\Hubspot\Resources\Events events()
34
 * @method \SevenShores\Hubspot\Resources\DealPipelines dealPipelines()
35
 * @method \SevenShores\Hubspot\Resources\DealProperties dealProperties()
36
 * @method \SevenShores\Hubspot\Resources\Deals deals()
37
 * @method \SevenShores\Hubspot\Resources\Owners owners()
38
 * @method \SevenShores\Hubspot\Resources\SingleEmail singleEmail()
39
 * @method \SevenShores\Hubspot\Resources\Integration integration()
40
 * @method \SevenShores\Hubspot\Resources\EcommerceBridge ecommerceBridge()
41
 * @method \SevenShores\Hubspot\Resources\Webhooks webhooks()
42
 */
43
class Factory
44
{
45
    /**
46
     * C O N S T R U C T O R ( ^_^)y.
47
     *
48
     * @param array  $config        An array of configurations. You need at least the 'key'.
49
     * @param Client $client
50
     * @param array  $clientOptions options to be send with each request
51
     * @param bool   $wrapResponse  wrap request response in own Response object
52
     */
53
    public function __construct($config = [], $client = null, $clientOptions = [], $wrapResponse = true)
54
    {
55
        $this->client = $client ?: new Client($config, null, $clientOptions, $wrapResponse);
0 ignored issues
show
The property client does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
56
    }
57
58
    /**
59
     * Create an instance of the service with an API key.
60
     *
61
     * @param string $api_key       Hubspot API key.
62
     * @param Client $client        An Http client.
63
     * @param array  $clientOptions options to be send with each request
64
     * @param bool   $wrapResponse  wrap request response in own Response object
65
     *
66
     * @return static
67
     */
68
    public static function create($api_key = null, $client = null, $clientOptions = [], $wrapResponse = true)
69
    {
70
        return new static(['key' => $api_key], $client, $clientOptions, $wrapResponse);
71
    }
72
73
    /**
74
     * Create an instance of the service with an Oauth token.
75
     *
76
     * @param string $token         Hubspot oauth access token.
77
     * @param Client $client        An Http client.
78
     * @param array  $clientOptions options to be send with each request
79
     * @param bool   $wrapResponse  wrap request response in own Response object
80
     *
81
     * @return static
82
     */
83
    public static function createWithToken($token, $client = null, $clientOptions = [], $wrapResponse = true)
84
    {
85
        return new static(['key' => $token, 'oauth' => true], $client, $clientOptions, $wrapResponse);
86
    }
87
88
    /**
89
     * Return an instance of a Resource based on the method called.
90
     *
91
     * @param string $name
92
     * @param array  $arguments
93
     *
94
     * @return \SevenShores\Hubspot\Resources\Resource
95
     */
96
    public function __call($name, $arguments = null)
97
    {
98
        $resource = 'SevenShores\\Hubspot\\Resources\\'.ucfirst($name);
99
100
        return new $resource($this->client);
101
    }
102
}
103