Issues (4)

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

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 Tgallice\Wit;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Tgallice\Wit\Model\Context;
7
8
/**
9
 * @deprecated This class is deprecated as of 0.1 and will be removed in 1.0.
10
 */
11
class Api
12
{
13
    /**
14
     * @var Client client
15
     */
16
    private $client;
17
18
    /**
19
     * @var MessageApi
20
     */
21
    private $messageApi;
22
23
    /**
24
     * @var SpeechApi
25
     */
26
    private $speechApi;
27
28
    /**
29
     * @var ConverseApi
30
     */
31
    private $converseApi;
32
33
    /**
34
     * @param Client $client
35
     */
36
    public function __construct(Client $client)
37
    {
38
        $this->client = $client;
39
        $this->messageApi = new MessageApi($client);
40
        $this->speechApi = new SpeechApi($client);
41
        $this->converseApi = new ConverseApi($client);
42
    }
43
44
    /**
45
     * @deprecated This method is deprecated as of 0.1 and will be removed in 1.0.
46
     *             You should use the ConverseApi::converse() instead
47
     *
48
     * @param string $sessionId
49
     * @param string $text
50
     * @param Context|null $context
51
     *
52
     * @return array|null
53
     */
54
    public function getConverseNextStep($sessionId, $text, Context $context = null)
55
    {
56
        return $this->converseApi->converse($sessionId, $text, $context);
57
    }
58
59
    /**
60
     * @deprecated This method is deprecated as of 0.1 and will be removed in 1.0.
61
     *             You should use the MessageApi::extractMeaning() instead
62
     *
63
     * @param string $text
64
     * @param Context|null $context
65
     * @param array $extraParams
66
     *
67
     * @return array|null
68
     */
69
    public function getIntentByText($text, Context $context = null, array $extraParams = [])
70
    {
71
        return $this->messageApi->extractMeaning($text, $context, $extraParams);
72
    }
73
74
    /**
75
     * @deprecated This method is deprecated as of 0.1 and will be removed in 1.0.
76
     *             You should use the SpeechApi::extractMeaning() instead
77
     *
78
     * @param string|resource $file
79
     * @param array|null $context
80
     * @param array $queryParams
81
     *
82
     * @return array|null
83
     */
84
    public function getIntentBySpeech($file, Context $context = null, array $queryParams = [])
85
    {
86
        return $this->speechApi->extractMeaning($file, $context, $queryParams);
87
    }
88
89
    /**
90
     * @deprecated This method is deprecated as of 0.1 and will be removed in 1.0.
91
     *
92
     * @param string $messageId
93
     *
94
     * @return array|null
95
     */
96
    public function getMessage($messageId)
97
    {
98
        $response = $this->client->get(sprintf('/messages/%s', $messageId));
99
100
        return $this->decodeResponse($response);
0 ignored issues
show
Deprecated Code introduced by
The method Tgallice\Wit\Api::decodeResponse() has been deprecated with message: This method is deprecated as of 0.1 and will be removed in 1.0. You should use the ResponseHandler::decodeResponse() instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
101
    }
102
103
    /**
104
     * @return Client
105
     */
106
    public function getClient()
107
    {
108
        return $this->client;
109
    }
110
111
    /**
112
     * @deprecated This method is deprecated as of 0.1 and will be removed in 1.0.
113
     *             You should use the ResponseHandler::decodeResponse() instead
114
     *
115
     * @param ResponseInterface $response
116
     *
117
     * @return array|null
118
     */
119
    protected function decodeResponse(ResponseInterface $response)
120
    {
121
        return json_decode((string) $response->getBody(), true);
122
    }
123
}
124