Skip to content

Commit 7de88e4

Browse files
Merge pull request chriskacerguis#426 from Tjoosten/master
Add access attribute to docblocks
2 parents 9c57c4b + dedc827 commit 7de88e4

File tree

1 file changed

+71
-14
lines changed

1 file changed

+71
-14
lines changed

application/libraries/REST_Controller.php

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ protected function early_checks()
190190

191191
/**
192192
* Constructor function
193-
* @todo Document more please.
193+
* @todo Document more please.
194+
* @access public
194195
*/
195196
public function __construct($config = 'rest')
196197
{
@@ -320,6 +321,8 @@ public function __construct($config = 'rest')
320321
/**
321322
* Destructor function
322323
* @author Chris Kacerguis
324+
*
325+
* @access public
323326
*/
324327
public function __destruct()
325328
{
@@ -339,8 +342,9 @@ public function __destruct()
339342
* an "object". This simply maps the object and method to the correct
340343
* Controller method.
341344
*
342-
* @param string $object_called
343-
* @param array $arguments The arguments passed to the controller method.
345+
* @access public
346+
* @param string $object_called
347+
* @param array $arguments The arguments passed to the controller method.
344348
*/
345349
public function _remap($object_called, $arguments)
346350
{
@@ -424,8 +428,9 @@ public function _remap($object_called, $arguments)
424428
*
425429
* Fires the designated controller method with the given arguments.
426430
*
427-
* @param array $method The controller method to fire
428-
* @param array $args The arguments to pass to the controller method
431+
* @access protected
432+
* @param array $method The controller method to fire
433+
* @param array $args The arguments to pass to the controller method
429434
*/
430435
protected function _fire_method($method, $args)
431436
{
@@ -438,9 +443,10 @@ protected function _fire_method($method, $args)
438443
* Takes pure data and optionally a status code, then creates the response.
439444
* Set $continue to TRUE to flush the response to the client and continue running the script.
440445
*
441-
* @param array $data
442-
* @param NULL|int $http_code
443-
* @param bool $continue
446+
* @access public
447+
* @param array $data
448+
* @param NULL|int $http_code
449+
* @param bool $continue
444450
*/
445451
public function response($data = NULL, $http_code = NULL, $continue = FALSE)
446452
{
@@ -513,10 +519,12 @@ public function response($data = NULL, $http_code = NULL, $continue = FALSE)
513519
}
514520
}
515521

516-
/*
522+
/**
517523
* Detect SSL use
518524
*
519-
* Detect whether SSL is being used or not
525+
* Detect whether SSL is being used or not.
526+
*
527+
* @access protected
520528
*/
521529
protected function _detect_ssl()
522530
{
@@ -526,10 +534,12 @@ protected function _detect_ssl()
526534
}
527535

528536

529-
/*
537+
/**
530538
* Detect input format
531539
*
532540
* Detect which format the HTTP Body is provided in
541+
*
542+
* @access protected
533543
*/
534544
protected function _detect_input_format()
535545
{
@@ -554,6 +564,7 @@ protected function _detect_input_format()
554564
*
555565
* Detect which format should be used to output the data.
556566
*
567+
* @access protected
557568
* @return string The output format.
558569
*/
559570
protected function _detect_output_format()
@@ -626,6 +637,7 @@ protected function _detect_output_format()
626637
*
627638
* Detect which HTTP method is being used
628639
*
640+
* @access protected
629641
* @return string
630642
*/
631643
protected function _detect_method()
@@ -652,6 +664,7 @@ protected function _detect_method()
652664
*
653665
* See if the user has provided an API key
654666
*
667+
* @access protected
655668
* @return boolean
656669
*/
657670
protected function _detect_api_key()
@@ -719,6 +732,7 @@ protected function _detect_api_key()
719732
*
720733
* What language do they want it in?
721734
*
735+
* @access protected
722736
* @return NULL|string The language code.
723737
*/
724738
protected function _detect_lang()
@@ -750,6 +764,7 @@ protected function _detect_lang()
750764
*
751765
* Record the entry for awesomeness purposes
752766
*
767+
* @access protected
753768
* @param boolean $authorized
754769
* @return object
755770
*/
@@ -775,6 +790,7 @@ protected function _log_request($authorized = FALSE)
775790
*
776791
* Check if the requests are coming in a tad too fast.
777792
*
793+
* @access protected
778794
* @param string $controller_method The method being called.
779795
* @return boolean
780796
*/
@@ -841,6 +857,7 @@ protected function _check_limit($controller_method)
841857
* Check if there is a specific auth type set for the current class/method
842858
* being called.
843859
*
860+
* @access protected
844861
* @return boolean
845862
*/
846863
protected function _auth_override_check()
@@ -922,6 +939,8 @@ protected function _auth_override_check()
922939

923940
/**
924941
* Parse GET
942+
*
943+
* @access protected
925944
*/
926945
protected function _parse_get()
927946
{
@@ -941,6 +960,8 @@ protected function _parse_get()
941960

942961
/**
943962
* Parse POST
963+
*
964+
* @access protected
944965
*/
945966
protected function _parse_post()
946967
{
@@ -951,6 +972,8 @@ protected function _parse_post()
951972

952973
/**
953974
* Parse PUT
975+
*
976+
* @access protected
954977
*/
955978
protected function _parse_put()
956979
{
@@ -970,6 +993,8 @@ protected function _parse_put()
970993

971994
/**
972995
* Parse HEAD
996+
*
997+
* @access protected
973998
*/
974999
protected function _parse_head()
9751000
{
@@ -982,6 +1007,8 @@ protected function _parse_head()
9821007

9831008
/**
9841009
* Parse OPTIONS
1010+
*
1011+
* @access protected
9851012
*/
9861013
protected function _parse_options()
9871014
{
@@ -994,6 +1021,8 @@ protected function _parse_options()
9941021

9951022
/**
9961023
* Parse PATCH
1024+
*
1025+
* @access protected
9971026
*/
9981027
protected function _parse_patch()
9991028
{
@@ -1012,6 +1041,8 @@ protected function _parse_patch()
10121041

10131042
/**
10141043
* Parse DELETE
1044+
*
1045+
* @access protected
10151046
*/
10161047
protected function _parse_delete()
10171048
{
@@ -1026,6 +1057,7 @@ protected function _parse_delete()
10261057
/**
10271058
* Retrieve a value from the GET request arguments.
10281059
*
1060+
* @access public
10291061
* @param string $key The key for the GET request argument to retrieve
10301062
* @param boolean $xss_clean Whether the value should be XSS cleaned or not.
10311063
* @return string The GET argument value.
@@ -1042,6 +1074,7 @@ public function get($key = NULL, $xss_clean = TRUE)
10421074
/**
10431075
* This function retrieves a values from the OPTIONS request arguments
10441076
*
1077+
* @access public
10451078
* @param string $key The OPTIONS/GET argument key
10461079
* @param boolean $xss_clean Whether the value should be XSS cleaned or not
10471080
* @return string The OPTIONS/GET argument value
@@ -1058,6 +1091,7 @@ public function options($key = NULL, $xss_clean = TRUE)
10581091
/**
10591092
* This function retrieves a values from the HEAD request arguments
10601093
*
1094+
* @access public
10611095
* @param string $key The HEAD/GET argument key
10621096
* @param boolean $xss_clean Whether the value should be XSS cleaned or not
10631097
* @return string The HEAD/GET argument value
@@ -1074,6 +1108,7 @@ public function head($key = NULL, $xss_clean = TRUE)
10741108
/**
10751109
* Retrieve a value from the POST request arguments.
10761110
*
1111+
* @access public
10771112
* @param string $key The key for the POST request argument to retrieve
10781113
* @param boolean $xss_clean Whether the value should be XSS cleaned or not.
10791114
* @return string The POST argument value.
@@ -1090,6 +1125,7 @@ public function post($key = NULL, $xss_clean = TRUE)
10901125
/**
10911126
* Retrieve a value from the PUT request arguments.
10921127
*
1128+
* @access public
10931129
* @param string $key The key for the PUT request argument to retrieve
10941130
* @param boolean $xss_clean Whether the value should be XSS cleaned or not.
10951131
* @return string The PUT argument value.
@@ -1106,6 +1142,7 @@ public function put($key = NULL, $xss_clean = TRUE)
11061142
/**
11071143
* Retrieve a value from the DELETE request arguments.
11081144
*
1145+
* @access public
11091146
* @param string $key The key for the DELETE request argument to retrieve
11101147
* @param boolean $xss_clean Whether the value should be XSS cleaned or not.
11111148
* @return string The DELETE argument value.
@@ -1122,6 +1159,7 @@ public function delete($key = NULL, $xss_clean = TRUE)
11221159
/**
11231160
* Retrieve a value from the PATCH request arguments.
11241161
*
1162+
* @access public
11251163
* @param string $key The key for the PATCH request argument to retrieve
11261164
* @param boolean $xss_clean Whether the value should be XSS cleaned or not.
11271165
* @return string The PATCH argument value.
@@ -1138,6 +1176,7 @@ public function patch($key = NULL, $xss_clean = TRUE)
11381176
/**
11391177
* Process to protect from XSS attacks.
11401178
*
1179+
* @access protected
11411180
* @param string $val The input.
11421181
* @param boolean $process Do clean or note the input.
11431182
* @return string
@@ -1154,6 +1193,7 @@ protected function _xss_clean($val, $process)
11541193
/**
11551194
* Retrieve the validation errors.
11561195
*
1196+
* @access public
11571197
* @return array
11581198
*/
11591199
public function validation_errors()
@@ -1168,6 +1208,7 @@ public function validation_errors()
11681208
/**
11691209
* Perform LDAP Authentication
11701210
*
1211+
* @access protected
11711212
* @param string $username The username to validate
11721213
* @param string $password The password to validate
11731214
* @return boolean
@@ -1265,6 +1306,7 @@ protected function _perform_ldap_auth($username = '', $password = NULL)
12651306
/**
12661307
* Perform Library Authentication - Override this function to change the way the library is called
12671308
*
1309+
* @access protected
12681310
* @param string $username The username to validate
12691311
* @param string $password The password to validate
12701312
* @return boolean
@@ -1299,6 +1341,7 @@ protected function _perform_library_auth($username = '', $password = NULL)
12991341
/**
13001342
* Check if the user is logged in.
13011343
*
1344+
* @access protected
13021345
* @param string $username The user's name
13031346
* @param string $password The user's password
13041347
* @return boolean
@@ -1346,6 +1389,8 @@ protected function _check_login($username = '', $password = FALSE)
13461389

13471390
/**
13481391
* Check to see if the user is logged into the web app with a php session key.
1392+
*
1393+
* @access protected
13491394
*/
13501395
protected function _check_php_session()
13511396
{
@@ -1357,6 +1402,8 @@ protected function _check_php_session()
13571402

13581403
/**
13591404
* @todo document this.
1405+
*
1406+
* @access protected
13601407
*/
13611408
protected function _prepare_basic_auth()
13621409
{
@@ -1388,6 +1435,8 @@ protected function _prepare_basic_auth()
13881435

13891436
/**
13901437
* @todo Document this.
1438+
*
1439+
* @access protected
13911440
*/
13921441
protected function _prepare_digest_auth()
13931442
{
@@ -1435,6 +1484,8 @@ protected function _prepare_digest_auth()
14351484

14361485
/**
14371486
* Check if the client's ip is in the 'rest_ip_blacklist' config
1487+
*
1488+
* @access protected
14381489
*/
14391490
protected function _check_blacklist_auth()
14401491
{
@@ -1451,6 +1502,8 @@ protected function _check_blacklist_auth()
14511502

14521503
/**
14531504
* Check if the client's ip is in the 'rest_ip_whitelist' config
1505+
*
1506+
* @access protected
14541507
*/
14551508
protected function _check_whitelist_auth()
14561509
{
@@ -1470,7 +1523,8 @@ protected function _check_whitelist_auth()
14701523
/**
14711524
* @todo Document this.
14721525
*
1473-
* @param string $nonce
1526+
* @access protected
1527+
* @param string $nonce
14741528
*/
14751529
protected function _force_login($nonce = '')
14761530
{
@@ -1486,8 +1540,9 @@ protected function _force_login($nonce = '')
14861540
/**
14871541
* Force it into an array
14881542
*
1489-
* @param object|array $data
1490-
* @return array
1543+
* @access protected
1544+
* @param object|array $data
1545+
* @return array
14911546
*/
14921547
protected function _force_loopable($data)
14931548
{
@@ -1502,6 +1557,7 @@ protected function _force_loopable($data)
15021557
/**
15031558
* updates the log with the access time
15041559
*
1560+
* @access protected
15051561
* @author Chris Kacerguis
15061562
* @return boolean
15071563
*/
@@ -1516,6 +1572,7 @@ protected function _log_access_time()
15161572
/**
15171573
* Check to see if the API key has access to the controller and methods
15181574
*
1575+
* @access protected
15191576
* @return boolean
15201577
*/
15211578
protected function _check_access()

0 commit comments

Comments
 (0)