Code Duplication    Length = 20-20 lines in 2 locations

src/DeleteTrait.php 2 locations

@@ 34-53 (lines=20) @@
31
     *
32
     * @return bool
33
     */
34
    public function deleteApiKey($key)
35
    {
36
        $ret = false;
37
38
        StaticValidator::execute($key, 'ApiKey');
39
40
        $options = [
41
            RequestOptions::QUERY => [
42
                'key' => $key,
43
            ],
44
        ];
45
46
        $response = $this->request('DELETE', $this->uri('/account/apikey'), $options);
47
48
        if ($response instanceof Response && 200 === $response->getStatusCode()) {
49
            $ret = true;
50
        }
51
52
        return $ret;
53
    }
54
55
    /**
56
     * Delete a template in template storage
@@ 64-83 (lines=20) @@
61
     *
62
     * @return bool
63
     */
64
    public function deleteTemplate($templateName)
65
    {
66
        $ret = false;
67
68
        StaticValidator::execute($templateName, 'TemplateName');
69
70
        $options = [
71
            RequestOptions::QUERY => [
72
                'templateName' => $templateName,
73
            ],
74
        ];
75
76
        $response = $this->request('DELETE', $this->uri('/templates/delete'), $options);
77
78
        if ($response instanceof Response && 204 === $response->getStatusCode()) {
79
            $ret = true;
80
        }
81
82
        return $ret;
83
    }
84
}
85