Skip to content

Commit 43cb19a

Browse files
committed
Tidied comments and removed whitespace
1 parent 44a92e5 commit 43cb19a

File tree

1 file changed

+11
-35
lines changed

1 file changed

+11
-35
lines changed

application/controllers/api/Key.php

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ class Key extends REST_Controller {
2626
];
2727

2828
/**
29-
* Key Create
3029
* Insert a key into the database
3130
*
32-
* @access public
33-
* @return void
31+
* @access public
32+
* @return void
3433
*/
3534
public function index_put()
3635
{
@@ -58,14 +57,11 @@ public function index_put()
5857
}
5958
}
6059

61-
// --------------------------------------------------------------------
62-
6360
/**
64-
* Key Delete
6561
* Remove a key from the database to stop it working
6662
*
67-
* @access public
68-
* @return void
63+
* @access public
64+
* @return void
6965
*/
7066
public function index_delete()
7167
{
@@ -91,14 +87,11 @@ public function index_delete()
9187
], REST_Controller::HTTP_NO_CONTENT); // NO_CONTENT (204) being the HTTP response code
9288
}
9389

94-
// --------------------------------------------------------------------
95-
9690
/**
97-
* Update Key
9891
* Change the level
9992
*
100-
* @access public
101-
* @return void
93+
* @access public
94+
* @return void
10295
*/
10396
public function level_post()
10497
{
@@ -132,14 +125,11 @@ public function level_post()
132125
}
133126
}
134127

135-
// --------------------------------------------------------------------
136-
137128
/**
138-
* Update Key
139129
* Change the level
140130
*
141-
* @access public
142-
* @return void
131+
* @access public
132+
* @return void
143133
*/
144134
public function suspend_post()
145135
{
@@ -172,14 +162,11 @@ public function suspend_post()
172162
}
173163
}
174164

175-
// --------------------------------------------------------------------
176-
177165
/**
178-
* Regenerate Key
179166
* Remove a key from the database to stop it working
180167
*
181-
* @access public
182-
* @return void
168+
* @access public
169+
* @return void
183170
*/
184171
public function regenerate_post()
185172
{
@@ -219,8 +206,6 @@ public function regenerate_post()
219206
}
220207
}
221208

222-
// --------------------------------------------------------------------
223-
224209
/* Helper Methods */
225210

226211
private function _generate_key()
@@ -243,8 +228,6 @@ private function _generate_key()
243228
return $new_key;
244229
}
245230

246-
// --------------------------------------------------------------------
247-
248231
/* Private Data Methods */
249232

250233
private function _get_key($key)
@@ -255,17 +238,13 @@ private function _get_key($key)
255238
->row();
256239
}
257240

258-
// --------------------------------------------------------------------
259-
260241
private function _key_exists($key)
261242
{
262243
return $this->db
263244
->where(config_item('rest_key_column'), $key)
264245
->count_all_results(config_item('rest_keys_table')) > 0;
265246
}
266247

267-
// --------------------------------------------------------------------
268-
269248
private function _insert_key($key, $data)
270249
{
271250
$data[config_item('rest_key_column')] = $key;
@@ -276,21 +255,18 @@ private function _insert_key($key, $data)
276255
->insert(config_item('rest_keys_table'));
277256
}
278257

279-
// --------------------------------------------------------------------
280-
281258
private function _update_key($key, $data)
282259
{
283260
return $this->db
284261
->where(config_item('rest_key_column'), $key)
285262
->update(config_item('rest_keys_table'), $data);
286263
}
287264

288-
// --------------------------------------------------------------------
289-
290265
private function _delete_key($key)
291266
{
292267
return $this->db
293268
->where(config_item('rest_key_column'), $key)
294269
->delete(config_item('rest_keys_table'));
295270
}
271+
296272
}

0 commit comments

Comments
 (0)