1 | <?php |
||
15 | class Railguns extends Api |
||
16 | { |
||
17 | /** |
||
18 | * Create Railgun (permission needed: #railgun:edit) |
||
19 | * |
||
20 | * @param string $name Readable identifier of the railgun |
||
21 | */ |
||
22 | public function create($name) |
||
30 | |||
31 | /** |
||
32 | * List Railguns (permission needed: #railgun:read) |
||
33 | * List, search, sort and filter your Railguns |
||
34 | * |
||
35 | * @param int|null $page Page number of paginated results |
||
36 | * @param int|null $per_page Number of items per page |
||
37 | * @param string|null $direction Direction to order Railguns (asc, desc) |
||
38 | */ |
||
39 | public function railguns($page = null, $per_page = null, $direction = null) |
||
49 | |||
50 | /** |
||
51 | * Railgun details (permission needed: #railgun:read) |
||
52 | * |
||
53 | * @param string $identifier API item identifier tag |
||
54 | */ |
||
55 | public function details($identifier) |
||
59 | |||
60 | /** |
||
61 | * Get zones connected to a Railgun (permission needed: #railgun:read) |
||
62 | * The zones that are currently using this Railgun |
||
63 | * |
||
64 | * @param string $identifier API item identifier tag |
||
65 | */ |
||
66 | public function zones($identifier) |
||
70 | |||
71 | /** |
||
72 | * Enable or disable a Railgun (permission needed: #railgun:edit) |
||
73 | * Enable or disable a Railgun for all zones connected to it |
||
74 | * |
||
75 | * @param string $identifier API item identifier tag |
||
76 | * @param bool|null $enabled Flag to determine if the Railgun is accepting connections |
||
77 | */ |
||
78 | public function enabled($identifier, $enabled = null) |
||
86 | |||
87 | /** |
||
88 | * Delete Railgun (permission needed: #railgun:edit) |
||
89 | * Disable and delete a Railgun. This will immediately disable the Railgun for any connected zones |
||
90 | * |
||
91 | * @param string $identifier API item identifier tag |
||
92 | */ |
||
93 | public function delete_railgun($identifier) |
||
97 | } |
||
98 |
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.