248
248
249
249
/**
250
250
* The default directory for the debug file under Unix.
251
+ * @return string directory for the debug file
251
252
*/
252
253
function gettmpdir () {
253
254
if (!empty ($ _ENV ['TMP ' ])) { return realpath ($ _ENV ['TMP ' ]); }
@@ -291,6 +292,7 @@ class phpCAS
291
292
private static $ _PHPCAS_CLIENT ;
292
293
293
294
/**
295
+ * @var array
294
296
* This variable is used to store where the initializer is called from
295
297
* (to print a comprehensive error in case of multiple calls).
296
298
*
@@ -299,6 +301,7 @@ class phpCAS
299
301
private static $ _PHPCAS_INIT_CALL ;
300
302
301
303
/**
304
+ * @var array
302
305
* This variable is used to store phpCAS debug mode.
303
306
*
304
307
* @hideinitializer
@@ -334,7 +337,7 @@ class phpCAS
334
337
* @param bool $changeSessionID Allow phpCAS to change the session_id (Single
335
338
* Sign Out/handleLogoutRequests is based on that change)
336
339
*
337
- * @return a newly created CAS_Client object
340
+ * @return void a newly created CAS_Client object
338
341
* @note Only one of the phpCAS::client() and phpCAS::proxy functions should be
339
342
* called, only once, and before all other methods (except phpCAS::getVersion()
340
343
* and phpCAS::setDebug()).
@@ -373,12 +376,12 @@ public static function client($server_version, $server_hostname,
373
376
*
374
377
* @param string $server_version the version of the CAS server
375
378
* @param string $server_hostname the hostname of the CAS server
376
- * @param string $server_port the port the CAS server is running on
379
+ * @param int $server_port the port the CAS server is running on
377
380
* @param string $server_uri the URI the CAS server is responding on
378
381
* @param bool $changeSessionID Allow phpCAS to change the session_id (Single
379
382
* Sign Out/handleLogoutRequests is based on that change)
380
383
*
381
- * @return a newly created CAS_Client object
384
+ * @return void a newly created CAS_Client object
382
385
* @note Only one of the phpCAS::client() and phpCAS::proxy functions should be
383
386
* called, only once, and before all other methods (except phpCAS::getVersion()
384
387
* and phpCAS::setDebug()).
@@ -495,7 +498,7 @@ public static function setVerbose($verbose)
495
498
/**
496
499
* Show is verbose mode is on
497
500
*
498
- * @return boot verbose
501
+ * @return bool verbose
499
502
*/
500
503
public static function getVerbose ()
501
504
{
@@ -635,7 +638,7 @@ public static function traceBegin()
635
638
* This method is used to indicate the end of the execution of a function in
636
639
* debug mode.
637
640
*
638
- * @param string $res the result of the function
641
+ * @param mixed $res the result of the function
639
642
*
640
643
* @return void
641
644
*/
@@ -646,7 +649,6 @@ public static function traceEnd($res = '')
646
649
} else {
647
650
self ::$ _PHPCAS_DEBUG ['indent ' ]--;
648
651
}
649
- $ dbg = debug_backtrace ();
650
652
$ str = '' ;
651
653
if (is_object ($ res )) {
652
654
$ str .= '<= ' . get_class ($ res );
@@ -713,7 +715,7 @@ public static function setLang($lang)
713
715
/**
714
716
* This method returns the phpCAS version.
715
717
*
716
- * @return the phpCAS version.
718
+ * @return string the phpCAS version.
717
719
*/
718
720
public static function getVersion ()
719
721
{
@@ -723,7 +725,7 @@ public static function getVersion()
723
725
/**
724
726
* This method returns supported protocols.
725
727
*
726
- * @return an array of all supported protocols. Use internal protocol name as array key.
728
+ * @return array an array of all supported protocols. Use internal protocol name as array key.
727
729
*/
728
730
public static function getSupportedProtocols ()
729
731
{
@@ -793,8 +795,8 @@ public static function setHTMLFooter($footer)
793
795
/**
794
796
* This method can be used to set a custom PGT storage object.
795
797
*
796
- * @param CAS_PGTStorage $storage a PGT storage object that inherits from the
797
- * CAS_PGTStorage class
798
+ * @param CAS_PGTStorage_AbstractStorage $storage a PGT storage object that inherits from the
799
+ * CAS_PGTStorage_AbstractStorage class
798
800
*
799
801
* @return void
800
802
*/
@@ -923,7 +925,7 @@ public static function initializeProxiedService (CAS_ProxiedService $proxiedServ
923
925
* This method is used to access an HTTP[S] service.
924
926
*
925
927
* @param string $url the service to access.
926
- * @param string &$err_code an error code Possible values are
928
+ * @param int &$err_code an error code Possible values are
927
929
* PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE,
928
930
* PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE,
929
931
* PHPCAS_SERVICE_NOT_AVAILABLE.
@@ -956,15 +958,15 @@ public static function serviceWeb($url, & $err_code, & $output)
956
958
* including the mailing box for IMAP URLs, as accepted by imap_open().
957
959
* @param string $service a string giving for CAS retrieve Proxy ticket
958
960
* @param string $flags options given to imap_open().
959
- * @param string &$err_code an error code Possible values are
961
+ * @param int &$err_code an error code Possible values are
960
962
* PHPCAS_SERVICE_OK (on success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE,
961
963
* PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE, PHPCAS_SERVICE_PT_FAILURE,
962
964
* PHPCAS_SERVICE_NOT_AVAILABLE.
963
965
* @param string &$err_msg an error message on failure
964
966
* @param string &$pt the Proxy Ticket (PT) retrieved from the CAS
965
967
* server to access the URL on success, false on error).
966
968
*
967
- * @return object IMAP stream on success, false otherwise (in this later
969
+ * @return object|false IMAP stream on success, false otherwise (in this later
968
970
* case, $err_code gives the reason why it failed and $err_msg contains an
969
971
* error message).
970
972
*/
@@ -1047,7 +1049,7 @@ public static function setCasAttributeParserCallback($function, array $additiona
1047
1049
* logs in (such as registering an account, performing logging, etc), register
1048
1050
* a callback function here.
1049
1051
*
1050
- * @param string $function Callback function
1052
+ * @param callable $function Callback function
1051
1053
* @param array $additionalArgs optional array of arguments
1052
1054
*
1053
1055
* @return void
@@ -1068,7 +1070,7 @@ public static function setPostAuthenticateCallback ($function, array $additional
1068
1070
* applications that manage their own sessions (rather than letting phpCAS
1069
1071
* start and destroy the session).
1070
1072
*
1071
- * @param string $function Callback function
1073
+ * @param callable $function Callback function
1072
1074
* @param array $additionalArgs optional array of arguments
1073
1075
*
1074
1076
* @return void
@@ -1086,7 +1088,7 @@ public static function setSingleSignoutCallback ($function, array $additionalArg
1086
1088
* determined by a cas gateway call.(cas login call without any interactive
1087
1089
* prompt)
1088
1090
*
1089
- * @return true when the user is authenticated, false when a previous
1091
+ * @return bool true when the user is authenticated, false when a previous
1090
1092
* gateway login failed or the function will not return if the user is
1091
1093
* redirected to the cas server for a gateway login attempt
1092
1094
*/
@@ -1154,7 +1156,7 @@ public static function renewAuthentication()
1154
1156
* This method is called to check if the user is authenticated (previously or by
1155
1157
* tickets given in the URL).
1156
1158
*
1157
- * @return true when the user is authenticated.
1159
+ * @return bool true when the user is authenticated.
1158
1160
*/
1159
1161
public static function isAuthenticated ()
1160
1162
{
@@ -1289,7 +1291,7 @@ public static function getAttribute($key)
1289
1291
*
1290
1292
* @return void
1291
1293
*/
1292
- public static function handleLogoutRequests ($ check_client = true , $ allowed_clients = false )
1294
+ public static function handleLogoutRequests ($ check_client = true , $ allowed_clients = array () )
1293
1295
{
1294
1296
phpCAS::_validateClientExists ();
1295
1297
@@ -1298,9 +1300,8 @@ public static function handleLogoutRequests($check_client = true, $allowed_clien
1298
1300
1299
1301
/**
1300
1302
* This method returns the URL to be used to login.
1301
- * or phpCAS::isAuthenticated().
1302
1303
*
1303
- * @return the login name of the authenticated user
1304
+ * @return string the login URL
1304
1305
*/
1305
1306
public static function getServerLoginURL ()
1306
1307
{
@@ -1405,10 +1406,9 @@ public static function setServerSamlValidateURL($url = '')
1405
1406
}
1406
1407
1407
1408
/**
1408
- * This method returns the URL to be used to login.
1409
- * or phpCAS::isAuthenticated().
1409
+ * This method returns the URL to be used to logout.
1410
1410
*
1411
- * @return the login name of the authenticated user
1411
+ * @return string the URL to use to log out
1412
1412
*/
1413
1413
public static function getServerLogoutURL ()
1414
1414
{
@@ -1612,7 +1612,7 @@ public static function getServiceURL()
1612
1612
* Retrieve a Proxy Ticket from the CAS server.
1613
1613
*
1614
1614
* @param string $target_service Url string of service to proxy
1615
- * @param string &$err_code error code
1615
+ * @param int &$err_code error code
1616
1616
* @param string &$err_msg error message
1617
1617
*
1618
1618
* @return string Proxy Ticket
0 commit comments