@@ -39,7 +39,7 @@ |
||
39 | 39 | public static function randomBytes($length) |
40 | 40 | { |
41 | 41 | // Get $length cryptographically secure pseudo-random bytes |
42 | - $rnd=\random_bytes($length); |
|
42 | + $rnd = \random_bytes($length); |
|
43 | 43 | |
44 | 44 | if (strlen($rnd) !== $length) { |
45 | 45 | throw new Exception("random_bytes did not return the requested number of bytes"); |
@@ -41,15 +41,15 @@ |
||
41 | 41 | { |
42 | 42 | $url = $this->_options["url"]."?appId=".$this->_options["appid"]; |
43 | 43 | |
44 | - $url.= "¬ificationToken=".$notificationToken; |
|
44 | + $url .= "¬ificationToken=".$notificationToken; |
|
45 | 45 | |
46 | 46 | $output = file_get_contents($url); |
47 | - if (stripos($output, "not found")!==false) { |
|
47 | + if (stripos($output, "not found") !== false) { |
|
48 | 48 | $this->logger->error('Token Exchange failed and responded with: not found', ['full output' => $output]); |
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
52 | - if (stripos($output, "error")!==false) { |
|
52 | + if (stripos($output, "error") !== false) { |
|
53 | 53 | $this->logger->error('Token Exchange failed and responded with: error', ['full output' => $output]); |
54 | 54 | return false; |
55 | 55 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * the Tiqr_DeviceStorage factory will call this for you. |
59 | 59 | * @param array $options The options for the s |
60 | 60 | */ |
61 | - public function __construct($options=array(), LoggerInterface $logger) |
|
61 | + public function __construct($options = array(), LoggerInterface $logger) |
|
62 | 62 | { |
63 | 63 | $this->_options = $options; |
64 | 64 | $this->logger = $logger; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * The default configuration |
52 | 52 | */ |
53 | 53 | const DEFAULT_HOST = '127.0.0.1'; |
54 | - const DEFAULT_PORT = 11211; |
|
54 | + const DEFAULT_PORT = 11211; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Get the prefix to use for all keys in memcache. |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * (non-PHPdoc) |
103 | 103 | * @see library/tiqr/Tiqr/StateStorage/Tiqr_StateStorage_Abstract::setValue() |
104 | 104 | */ |
105 | - public function setValue($key, $value, $expire=0) |
|
105 | + public function setValue($key, $value, $expire = 0) |
|
106 | 106 | { |
107 | 107 | $key = $this->_getKeyPrefix().$key; |
108 | 108 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return Tiqr_UserStorage_Encryption_Interface |
42 | 42 | */ |
43 | - public static function getEncryption(LoggerInterface $logger, $type="dummy", $options=array()) |
|
43 | + public static function getEncryption(LoggerInterface $logger, $type = "dummy", $options = array()) |
|
44 | 44 | { |
45 | 45 | $logger->info(sprintf('Using %s as UserStorage encryption type', $type)); |
46 | 46 | switch ($type) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | if ($data === NULL) { |
33 | 33 | if ($failIfNotFound) { |
34 | - throw new Exception('Error loading data for user: ' . var_export($userId, TRUE)); |
|
34 | + throw new Exception('Error loading data for user: '.var_export($userId, TRUE)); |
|
35 | 35 | } else { |
36 | 36 | $this->logger->error('Error loading data for user from user storage (file storage)'); |
37 | 37 | return false; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function getPath() |
49 | 49 | { |
50 | - if (substr($this->path, -1)!="/") return $this->path."/"; |
|
50 | + if (substr($this->path, -1) != "/") return $this->path."/"; |
|
51 | 51 | return $this->path; |
52 | 52 | } |
53 | 53 | } |
@@ -47,7 +47,9 @@ |
||
47 | 47 | */ |
48 | 48 | public function getPath() |
49 | 49 | { |
50 | - if (substr($this->path, -1)!="/") return $this->path."/"; |
|
50 | + if (substr($this->path, -1)!="/") { |
|
51 | + return $this->path."/"; |
|
52 | + } |
|
51 | 53 | return $this->path; |
52 | 54 | } |
53 | 55 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function encrypt($data); |
42 | 42 | |
43 | 43 | /** |
44 | - * Decrypts the given data. |
|
44 | + * Decrypts the given data. |
|
45 | 45 | * |
46 | 46 | * @param String $data Data to decrypt. |
47 | 47 | * |
@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Decrypts the given data. |
|
60 | + * Decrypts the given data. |
|
61 | 61 | * |
62 | 62 | * @param String $data Data to decrypt. |
63 | 63 | * |
@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Decrypts the given data. |
|
60 | + * Decrypts the given data. |
|
61 | 61 | * |
62 | 62 | * @param String $data Data to decrypt. |
63 | 63 | * |