1 | <?php |
||
17 | class Certificates extends Api |
||
18 | { |
||
19 | /** |
||
20 | * List Certificates |
||
21 | * List all existing CloudFlare-issued Certificates for a given zone. Use your Certificates API Key as your |
||
22 | * User Service Key when calling this endpoint |
||
23 | */ |
||
24 | public function certificates($page = null, $per_page = null, $direction = null) |
||
34 | |||
35 | /** |
||
36 | * Create Certificate |
||
37 | * Create a CloudFlare-signed certificate. Use your Certificates API Key as your User Service Key when |
||
38 | * calling this endpoint |
||
39 | * |
||
40 | * @param array $hostnames Array of hostnames or wildcard names (e.g., *.example.com) bound to the certificate |
||
41 | * @param string $request_type Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers) |
||
42 | * @param string $csr The Certificate Signing Request (CSR). Must be newline-encoded. |
||
43 | * @param int|null $requested_validity The number of days for which the certificate should be valid |
||
44 | */ |
||
45 | public function create($hostnames, $request_type, $csr, $requested_validity = null) |
||
56 | |||
57 | /** |
||
58 | * Certificate Details |
||
59 | * Get an existing certificate by its serial number. Use your Certificates API Key as your User Service Key |
||
60 | * when calling this endpoint |
||
61 | * |
||
62 | * @param string $identifier API item identifier tag |
||
63 | */ |
||
64 | public function details($identifier) |
||
68 | |||
69 | /** |
||
70 | * Revoke certificate |
||
71 | * Revoke a created certificate for a zone. Use your Certificates API Key as your User Service Key when |
||
72 | * calling this endpoint |
||
73 | * |
||
74 | * @param string $identifier API item identifier tag |
||
75 | */ |
||
76 | public function revoke($identifier) |
||
80 | } |
||
81 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.