Code Duplication    Length = 17-21 lines in 4 locations

src/Form.php 2 locations

@@ 155-171 (lines=17) @@
152
     * @param  string $formId
153
     * @return object
154
     */
155
    public function enable(string $formId)
156
    {
157
        // make the URL for this request
158
        $url = sprintf('%s/EnableForm?formId=%s', $this->getBaseUrl(), $formId);
159
160
        // get the headers for this request
161
        $headers = $this->headers->make('PUT', $url, []);
162
163
        // get the response
164
        $response = $this->client->put($url, [
165
            'headers' => $headers,
166
            'json' => [],
167
        ]);
168
169
        // return the response
170
        return $response;
171
    }
172
173
    /**
174
     * Disables the form.
@@ 179-195 (lines=17) @@
176
     * @param  string $formId
177
     * @return object
178
     */
179
    public function disable(string $formId)
180
    {
181
        // make the URL for this request
182
        $url = sprintf('%s/DisableForm?formId=%s', $this->getBaseUrl(), $formId);
183
184
        // get the headers for this request
185
        $headers = $this->headers->make('PUT', $url, []);
186
187
        // get the response
188
        $response = $this->client->put($url, [
189
            'headers' => $headers,
190
            'json' => [],
191
        ]);
192
193
        // return the response
194
        return $response;
195
    }
196
}
197

src/RequestId.php 1 location

@@ 18-38 (lines=21) @@
15
     * @param  bool   $metadata
16
     * @return object
17
     */
18
    public function getDetails(string $requestId, bool $metadata)
19
    {
20
        // make the URL for this request
21
        $url = sprintf(
22
            '%s/%s?metadata=%s',
23
            $this->getBaseUrl(),
24
            $requestId,
25
            $metadata ? 'true' : 'false'
26
        );
27
28
        // get the headers for this request
29
        $headers = $this->headers->make('GET', $url);
30
31
        // get the response
32
        $response = $this->client->get($url, [
33
            'headers' => $headers,
34
        ]);
35
36
        // return the response
37
        return $response;
38
    }
39
40
    /**
41
     * Check if a SignereID session is completed or not.

src/DocumentProvider.php 1 location

@@ 65-85 (lines=21) @@
62
     * @param  bool|bool $demo
63
     * @return object
64
     */
65
    public function getUsage(string $providerId, bool $demo = false)
66
    {
67
        // make the URL for this request
68
        $url = sprintf(
69
            '%s/quota/%s?ProviderId=%s',
70
            $this->getBaseUrl(),
71
            $demo ? 'demo' : 'prepaid',
72
            $providerId
73
        );
74
75
        // get the headers for this request
76
        $headers = $this->headers->make('GET', $url);
77
78
        // get the response
79
        $response = $this->client->get($url, [
80
            'headers' => $headers,
81
        ]);
82
83
        // return the response
84
        return $response;
85
    }
86
87
    /**
88
     * Creates a new document provider.