Skip to content

Commit 5e776cf

Browse files
committed
Some more lint fixes.
1 parent 61b2af3 commit 5e776cf

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

libs/csrf/csrfprotector.php

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if (!defined('__CSRF_PROTECTOR__')) {
1111
define('__CSRF_PROTECTOR__', true); // to avoid multiple declaration errors
1212

13-
// name of HTTP POST variable for authentication
13+
// Name of HTTP POST variable for authentication
1414
define("CSRFP_TOKEN","CSRFP-Token");
1515

1616
// We insert token name and list of url patterns for which
@@ -19,12 +19,13 @@
1919
define("CSRFP_FIELD_TOKEN_NAME", "csrfp_hidden_data_token");
2020
define("CSRFP_FIELD_URLS", "csrfp_hidden_data_urls");
2121

22-
/**
23-
* child exception classes
24-
*/
22+
/** Indicates configuration file was not found. */
2523
class configFileNotFoundException extends \exception {};
26-
class jsFileNotFoundException extends \exception {};
24+
25+
/** Indicates that configuration file is incomplete. */
2726
class incompleteConfigurationException extends \exception {};
27+
28+
/** Indicates that CSRF Protector is already initialized. */
2829
class alreadyInitializedException extends \exception {};
2930

3031
class csrfProtector
@@ -75,29 +76,38 @@ class csrfProtector
7576
* Variable: $config
7677
* config file for CSRFProtector
7778
* @var int Array, length = 6
78-
* Property: #1: failedAuthAction (int) => action to be taken in case autherisation fails
79-
* Property: #3: customErrorMessage (string) => custom error message to be sent in case
80-
* of failed authentication
81-
* Property: #4: jsFile (string) => location of the CSRFProtector js file
82-
* Property: #5: tokenLength (int) => default length of hash
83-
* Property: #6: disabledJavascriptMessage (string) => error message if client's js is disabled
79+
* Property: #1: failedAuthAction (int) => action to be taken in case
80+
* autherisation fails.
81+
* Property: #3: customErrorMessage (string) => custom error message to
82+
* be sent in case of failed authentication.
83+
* Property: #4: jsFile (string) => location of the CSRFProtector js
84+
* file.
85+
* Property: #5: tokenLength (int) => default length of hash.
86+
* Property: #6: disabledJavascriptMessage (string) => error message if
87+
* client's js is disabled.
88+
*
89+
* TODO(mebjas): this field should be private
8490
*/
8591
public static $config = array();
8692

8793
/*
8894
* Variable: $requiredConfigurations
8995
* Contains list of those parameters that are required to be there
9096
* in config file for csrfp to work
97+
*
98+
* TODO(mebjas): this field should be private
9199
*/
92-
public static $requiredConfigurations = array('failedAuthAction', 'jsUrl', 'tokenLength');
100+
public static $requiredConfigurations = array(
101+
'failedAuthAction', 'jsUrl', 'tokenLength');
93102

94103
/*
95104
* Function: function to initialise the csrfProtector work flow
96105
*
97106
* Parameters:
98-
* $length - length of CSRF_AUTH_TOKEN to be generated
99-
* $action - int array, for different actions to be taken in case of failed validation
100-
* $logger - custom logger class object
107+
* $length - (int) length of CSRF_AUTH_TOKEN to be generated.
108+
* $action - (int array), for different actions to be taken in case of
109+
* failed validation.
110+
* $logger - (LoggerInterface) custom logger class object.
101111
*
102112
* Returns:
103113
* void
@@ -210,11 +220,10 @@ public static function init($length = null, $action = null, $logger = null)
210220
*
211221
* Returns:
212222
* void
213-
*
214-
* Throws:
215-
* logDirectoryNotFoundException - if log directory is not found
223+
*
224+
* TODO(mebjas): this method should be private.
216225
*/
217-
private static function authorizePost()
226+
public static function authorizePost()
218227
{
219228
// TODO(mebjas): this method is valid for same origin request only,
220229
// enable it for cross origin also sometime for cross origin the

0 commit comments

Comments
 (0)