From 8dd11def8fab94d7c8fe68d6affeebee940b339a Mon Sep 17 00:00:00 2001 From: CodeLingoBot Date: Fri, 5 Apr 2019 20:12:52 +1300 Subject: [PATCH] Change PHP keywords to comply with PSR2 Signed-off-by: CodeLingoBot --- Yubico.php | 16 ++++++++-------- demo.php | 2 +- example/Modhex.php | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Yubico.php b/Yubico.php index d8aa41c..26e7d8c 100644 --- a/Yubico.php +++ b/Yubico.php @@ -255,7 +255,7 @@ function getParameters($parameters) * @return mixed PEAR error on error, true otherwise * @access public */ - function verify($token, $use_timestamp=null, $wait_for_all=False, + function verify($token, $use_timestamp=null, $wait_for_all=false, $sl=null, $timeout=null) { /* Construct parameters string */ @@ -314,8 +314,8 @@ function verify($token, $use_timestamp=null, $wait_for_all=False, /* Execute and read request. */ $this->_response=null; - $replay=False; - $valid=False; + $replay=false; + $valid=false; do { /* Let curl do its work. */ while (($mrc = curl_multi_exec($mh, $active)) @@ -367,7 +367,7 @@ function verify($token, $use_timestamp=null, $wait_for_all=False, $parameters=array('nonce','otp', 'sessioncounter', 'sessionuse', 'sl', 'status', 't', 'timeout', 'timestamp'); sort($parameters); - $check=Null; + $check=null; foreach ($parameters as $param) { if (array_key_exists($param, $response)) { if ($check) $check = $check . '&'; @@ -382,22 +382,22 @@ function verify($token, $use_timestamp=null, $wait_for_all=False, if($response['h'] == $checksignature) { if ($status == 'REPLAYED_OTP') { if (!$wait_for_all) { $this->_response = $str; } - $replay=True; + $replay=true; } if ($status == 'OK') { if (!$wait_for_all) { $this->_response = $str; } - $valid=True; + $valid=true; } } } else { /* Case 3. We check the status directly */ if ($status == 'REPLAYED_OTP') { if (!$wait_for_all) { $this->_response = $str; } - $replay=True; + $replay=true; } if ($status == 'OK') { if (!$wait_for_all) { $this->_response = $str; } - $valid=True; + $valid=true; } } } diff --git a/demo.php b/demo.php index e115b03..9c6d7da 100644 --- a/demo.php +++ b/demo.php @@ -99,7 +99,7 @@ addURLpart($u); diff --git a/example/Modhex.php b/example/Modhex.php index 28e9238..325f35c 100644 --- a/example/Modhex.php +++ b/example/Modhex.php @@ -35,15 +35,15 @@ static function decode($token) { $decoded = ""; // decoded string to be returned // strings must have an even length - if ( $tokLen % 2 != 0 ) { return FALSE; } + if ( $tokLen % 2 != 0 ) { return false; } for ($i = 0; $i < $tokLen; $i=$i+2 ) { $high = strpos(ModHex::$TRANSKEY, $token[$i]); $low = strpos(ModHex::$TRANSKEY, $token[$i+1]); // if there's an invalid character in the encoded $token, fail here. - if ( $high === FALSE || $low === FALSE ) - return FALSE; + if ( $high === false || $low === false ) + return false; $decoded .= chr(($high << 4) | $low); }