Issues (5)

src/ClientInterface.php (1 issue)

Labels
Severity
1
<?php
2
namespace TraderInteractive\Api;
3
4
/**
5
 * Client for apis
6
 */
7
interface ClientInterface
8
{
9
    /**
10
     * Get access token and refresh token
11
     *
12
     * @return array two string values, access token and refresh token
13
     */
14
    public function getTokens() : array;
15
16
    /**
17
     * Search the API resource using the specified $filters
18
     *
19
     * @param string $resource
20
     * @param array $filters
21
     *
22
     * @return string opaque handle to be given to endIndex()
23
     */
24
    public function startIndex(string $resource, array $filters = []) : string;
25
26
    /**
27
     * @see startIndex()
28
     */
29
    public function index(string $resource, array $filters = []) : Response;
30
31
    /**
32
     * Get the details of an API resource based on $id
33
     *
34
     * @param string $resource
35
     * @param string $id
36
     * @param array  $parameters
37
     *
38
     * @return string opaque handle to be given to endGet()
39
     */
40
    public function startGet(string $resource, string $id, array $parameters = []) : string;
41
42
    /**
43
     * @see startGet()
44
     */
45
    public function get(string $resource, string $id, array $parameters = []) : Response;
46
47
    /**
48
     * Create a new instance of an API resource using the provided $data
49
     *
50
     * @param string $resource
51
     * @param array $data
52
     *
53
     * @return string opaque handle to be given to endPost()
54
     */
55
    public function startPost(string $resource, array $data) : string;
56
57
    /**
58
     * @see startPost()
59
     */
60
    public function post(string $resource, array $data) : Response;
61
62
    /**
63
     * Update an existing instance of an API resource specified by $id with the provided $data
64
     *
65
     * @param string $resource
66
     * @param string $id
67
     * @param array $data
68
     *
69
     * @return string opaque handle to be given to endPut()
70
     */
71
    public function startPut(string $resource, string $id, array $data) : string;
72
73
    /**
74
     * @see startPut()
75
     */
76
    public function put(string $resource, string $id, array $data) : Response;
77
78
    /**
79
     * Delete an existing instance of an API resource specified by $id
80
     *
81
     * @param string $resource
82
     * @param string $id
83
     * @param array $data
84
     *
85
     * @return string opaque handle to be given to endDelete()
86
     */
87
    public function startDelete(string $resource, string $id = null, array $data = null) : string;
88
89
    /**
90
     * @see startDelete()
91
     */
92
    public function delete(string $resource, string $id = null, array $data = null) : Response;
93
94
    /**
95
     * Performs a request to the given URI and returns the response.
96
     *
97
     * @param string $method The HTTP method of the request to send.
98
     * @param string $uri    A relative api URI to which the POST request will be made.
99
     * @param array  $data   Array of data to be sent as the POST body.
100
     *
101
     * @return Response
102
     */
103
    public function send(string $method, string $uri, array $data = null) : Response;
104
105
    /**
106
     * Starts a request to the given URI.
107
     *
108
     * @param string $method The HTTP method of the request to send.
109
     * @param string $uri    A relative api URI to which the POST request will be made.
110
     * @param array  $data   Array of data to be sent as the POST body.
111
     *
112
     * @return string opaque handle to be given to endDelete()
113
     */
114
    public function startSend(string $method, string $uri, array $data = null) : string;
115
116
    /**
117
     * Get response of start*() method
118
     *
119
     * @param string $handle opaque handle from start*()
120
     *
121
     * @return Response
122
     */
123
    public function end(string $handle) : Response;
124
125
    /**
126
     * Set the default headers
127
     *
128
     * @param array The default headers
0 ignored issues
show
The type TraderInteractive\Api\The was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
129
     *
130
     * @return void
131
     */
132
    public function setDefaultHeaders(array $defaultHeaders);
133
}
134