Issues (86)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/Trucker/Responses/Response.php (2 issues)

1
<?php
2
3
namespace Trucker\Responses;
4
5
use Guzzle\Http\Message\Response as GuzzleResponse;
6
use Illuminate\Container\Container;
7
use Trucker\Facades\TransporterFactory;
8
9
class Response extends BaseResponse
10
{
11
    /**
12
     * The IoC Container.
13
     *
14
     * @var Container
15
     */
16
    protected $app;
17
18
    /**
19
     * Response object managed by this
20
     * class.
21
     *
22
     * @var GuzzleResponse
23
     */
24
    protected $response;
25
26
    /**
27
     * Response constructor.
28
     *
29
     * @param Container           $app
30
     * @param GuzzleResponse|null $response
31
     */
32 32
    public function __construct(Container $app, GuzzleResponse $response = null)
33
    {
34 32
        $this->app = $app;
35
36 32
        parent::__construct($response);
37 32
    }
38
39
    /**
40
     * Getter to access the IoC Container.
41
     *
42
     * @return Container
43
     */
44 1
    public function getApp()
45
    {
46 1
        return $this->app;
47
    }
48
49
    /**
50
     * Magic function to pass methods not found
51
     * on this class down to the guzzle response
52
     * object that is being wrapped.
53
     *
54
     * @param string $method name of called method
55
     * @param array  $args   arguments to the method
56
     *
57
     * @return mixed
58
     */
59 25 View Code Duplication
    public function __call($method, $args)
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...
60
    {
61 25
        if (!method_exists($this, $method)) {
62 25
            return call_user_func_array(
63 25
                [$this->response, $method],
64 25
                $args
65
            );
66
        }
67
        // @codeCoverageIgnoreStart
68
    }
69
70
    // @codeCoverageIgnoreEnd
71
72
    /**
73
     * @param Container      $app
74
     * @param GuzzleResponse $response
75
     *
76
     * @return Response
77
     */
78 25
    public function newInstance(Container $app, GuzzleResponse $response)
79
    {
80
        // This method just provides a convenient way for us to generate fresh model
81
        // instances of this current model. It is particularly useful during the
82
        // hydration of new objects via the Eloquent query builder instances.
83 25
        return new static($app, $response);
84
    }
85
86
    /**
87
     * Function to take a response object and convert it
88
     * into an array of data that is ready for use.
89
     *
90
     * @return array Parsed array of data
91
     */
92 11
    public function parseResponseToData()
93
    {
94 11
        $transporter = TransporterFactory::build();
0 ignored issues
show
The method build() does not exist on Trucker\Facades\TransporterFactory. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

94
        /** @scrutinizer ignore-call */ 
95
        $transporter = TransporterFactory::build();
Loading history...
95
96 11
        return $transporter->parseResponseToData($this->response);
97
    }
98
99
    /**
100
     * Function to take a response string (as a string) and depending on
101
     * the type of string it is, parse it into an object.
102
     *
103
     * @return mixed
104
     */
105 7
    public function parseResponseStringToObject()
106
    {
107 7
        $transporter = TransporterFactory::build();
108
109 7
        return $transporter->parseResponseStringToObject($this->response);
110
    }
111
}
112