Code Duplication    Length = 16-21 lines in 4 locations

src/DocumentProvider.php 1 location

@@ 84-104 (lines=21) @@
81
     * @param  bool|bool $demo
82
     * @return object
83
     */
84
    public function getUsage(string $providerId, bool $demo = false)
85
    {
86
        // make the URL for this request
87
        $url = sprintf(
88
            '%s/quota/%s?ProviderId=%s',
89
            self::URI,
90
            $demo ? 'demo' : 'prepaid',
91
            $providerId
92
        );
93
94
        // get the headers for this request
95
        $headers = $this->headers->make('GET', $url);
96
97
        // get the response
98
        $response = $this->client->get($url, [
99
            'headers' => $headers,
100
        ]);
101
102
        // return the response
103
        return $response;
104
    }
105
106
    /**
107
     * Creates a new document provider.

src/Form.php 2 locations

@@ 173-189 (lines=17) @@
170
     * @param  string $formId
171
     * @return object
172
     */
173
    public function enable(string $formId)
174
    {
175
        // make the URL for this request
176
        $url = sprintf('%s/EnableForm?formId=%s', self::URI, $formId);
177
178
        // get the headers for this request
179
        $headers = $this->headers->make('PUT', $url, []);
180
181
        // get the response
182
        $response = $this->client->put($url, [
183
            'headers' => $headers,
184
            'json' => [],
185
        ]);
186
187
        // return the response
188
        return $response;
189
    }
190
191
    /**
192
     * Disables the form.
@@ 197-213 (lines=17) @@
194
     * @param  string $formId
195
     * @return object
196
     */
197
    public function disable(string $formId)
198
    {
199
        // make the URL for this request
200
        $url = sprintf('%s/DisableForm?formId=%s', self::URI, $formId);
201
202
        // get the headers for this request
203
        $headers = $this->headers->make('PUT', $url, []);
204
205
        // get the response
206
        $response = $this->client->put($url, [
207
            'headers' => $headers,
208
            'json' => [],
209
        ]);
210
211
        // return the response
212
        return $response;
213
    }
214
}
215

src/RequestId.php 1 location

@@ 37-52 (lines=16) @@
34
     * @param  bool   $metadata
35
     * @return object
36
     */
37
    public function getDetails(string $requestId, bool $metadata)
38
    {
39
        // make the URL for this request
40
        $url = sprintf('%s/%s?metadata=%s', self::URI, $requestId, $metadata ? 'true' : 'false');
41
42
        // get the headers for this request
43
        $headers = $this->headers->make('GET', $url);
44
45
        // get the response
46
        $response = $this->client->get($url, [
47
            'headers' => $headers,
48
        ]);
49
50
        // return the response
51
        return $response;
52
    }
53
54
    /**
55
     * Check if a SignereID session is completed or not.