@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * |
| 39 | 39 | * @return Tiqr_UserStorage_Encryption_Interface |
| 40 | 40 | */ |
| 41 | - public static function getEncryption($type="dummy", $options=array()) |
|
| 41 | + public static function getEncryption($type = "dummy", $options = array()) |
|
| 42 | 42 | { |
| 43 | 43 | switch ($type) { |
| 44 | 44 | case "dummy": |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | if ($data === NULL) { |
| 69 | 69 | if ($failIfNotFound) { |
| 70 | - throw new Exception('Error loading data for user: ' . var_export($userId, TRUE)); |
|
| 70 | + throw new Exception('Error loading data for user: '.var_export($userId, TRUE)); |
|
| 71 | 71 | } else { |
| 72 | 72 | return false; |
| 73 | 73 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function getPath() |
| 96 | 96 | { |
| 97 | - if (substr($this->_path, -1)!="/") return $this->_path."/"; |
|
| 97 | + if (substr($this->_path, -1) != "/") return $this->_path."/"; |
|
| 98 | 98 | return $this->_path; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return Tiqr_OcraService_Interface |
| 38 | 38 | */ |
| 39 | - public static function getOcraService($type="tiqr", $options=array()) |
|
| 39 | + public static function getOcraService($type = "tiqr", $options = array()) |
|
| 40 | 40 | { |
| 41 | 41 | switch ($type) { |
| 42 | 42 | case "tiqr": |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if (!isset($type)) { |
| 52 | 52 | throw new Exception('Class name not set'); |
| 53 | 53 | } elseif (!class_exists($type)) { |
| 54 | - throw new Exception('Class not found: ' . var_export($type, TRUE)); |
|
| 54 | + throw new Exception('Class not found: '.var_export($type, TRUE)); |
|
| 55 | 55 | } |
| 56 | 56 | $instance = new $type($options); |
| 57 | 57 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * options per type. |
| 44 | 44 | * @throws Exception If an unknown type is requested. |
| 45 | 45 | */ |
| 46 | - public static function getStorage($type="file", $options=array()) |
|
| 46 | + public static function getStorage($type = "file", $options = array()) |
|
| 47 | 47 | { |
| 48 | 48 | switch ($type) { |
| 49 | 49 | case "file": |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | if (!isset($type)) { |
| 63 | 63 | throw new Exception('Class name not set'); |
| 64 | 64 | } elseif (!class_exists($type)) { |
| 65 | - throw new Exception('Class not found: ' . var_export($type, TRUE)); |
|
| 65 | + throw new Exception('Class not found: '.var_export($type, TRUE)); |
|
| 66 | 66 | } elseif (!is_subclass_of($type, 'Tiqr_StateStorage_Abstract')) { |
| 67 | - throw new Exception('Class ' . $type . ' not subclass of Tiqr_StateStorage_Abstract'); |
|
| 67 | + throw new Exception('Class '.$type.' not subclass of Tiqr_StateStorage_Abstract'); |
|
| 68 | 68 | } |
| 69 | 69 | $instance = new $type($options); |
| 70 | 70 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * the Tiqr_DeviceStorage factory will call this for you. |
| 54 | 54 | * @param array $options The options for the s |
| 55 | 55 | */ |
| 56 | - public function __construct($options=array()) |
|
| 56 | + public function __construct($options = array()) |
|
| 57 | 57 | { |
| 58 | 58 | $this->_options = $options; |
| 59 | 59 | } |
@@ -41,11 +41,11 @@ |
||
| 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) return false; |
|
| 48 | - if (stripos($output, "error")!==false) return false; |
|
| 47 | + if (stripos($output, "not found") !== false) return false; |
|
| 48 | + if (stripos($output, "error") !== false) return false; |
|
| 49 | 49 | return trim($output); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $this->tablename = isset($config['table']) ? $config['table'] : 'tiqrusersecret'; |
| 42 | 42 | try { |
| 43 | - $this->handle = new PDO($config['dsn'],$config['username'],$config['password']); |
|
| 43 | + $this->handle = new PDO($config['dsn'], $config['username'], $config['password']); |
|
| 44 | 44 | } catch (PDOException $e) { |
| 45 | 45 | return false; |
| 46 | 46 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } else { |
| 74 | 74 | $sth = $this->handle->prepare("INSERT INTO ".$this->tablename." (secret,userid) VALUES (?,?)"); |
| 75 | 75 | } |
| 76 | - $sth->execute(array($secret,$userId)); |
|
| 76 | + $sth->execute(array($secret, $userId)); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public static function log($message) |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * config options per type. |
| 43 | 43 | * @throws Exception An exception if an unknown storage is requested. |
| 44 | 44 | */ |
| 45 | - public static function getStorage($type="dummy", $options=array()) |
|
| 45 | + public static function getStorage($type = "dummy", $options = array()) |
|
| 46 | 46 | { |
| 47 | 47 | switch ($type) { |
| 48 | 48 | case "dummy": |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | default: |
| 58 | 58 | $instance = NULL; |
| 59 | 59 | } |
| 60 | - if ($instance!=NULL) { |
|
| 60 | + if ($instance != NULL) { |
|
| 61 | 61 | $instance->init(); |
| 62 | 62 | return $instance; |
| 63 | 63 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public static function autoload($className) { |
| 26 | - if($className === NULL) { |
|
| 26 | + if ($className === NULL) { |
|
| 27 | 27 | return; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | $substr5 = substr($className, 0, 5); |
| 33 | 33 | |
| 34 | 34 | if ($substr5 === 'Tiqr_' || $substr5 === 'OATH_') { |
| 35 | - $file = $self->tiqrPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
| 35 | + $file = $self->tiqrPath.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
| 36 | 36 | } elseif ($className === 'QRcode') { |
| 37 | - $file = $self->qrcodePath . DIRECTORY_SEPARATOR . 'phpqrcode.php'; |
|
| 37 | + $file = $self->qrcodePath.DIRECTORY_SEPARATOR.'phpqrcode.php'; |
|
| 38 | 38 | } elseif ($substr5 === 'Zend_') { |
| 39 | - $file = $self->zendPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
| 39 | + $file = $self->zendPath.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
| 40 | 40 | } else { |
| 41 | 41 | return; |
| 42 | 42 | } |
@@ -57,34 +57,34 @@ discard block |
||
| 57 | 57 | if (is_dir($tiqr_path)) { |
| 58 | 58 | $this->tiqrPath = $tiqr_path; |
| 59 | 59 | } else { |
| 60 | - throw new Exception('Directory not found: ' . var_export($tiqr_dir, TRUE)); |
|
| 60 | + throw new Exception('Directory not found: '.var_export($tiqr_dir, TRUE)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (isset($options["phpqrcode.path"])) { |
| 64 | 64 | $qrcode_dir = $options["phpqrcode.path"]; |
| 65 | 65 | $qrcode_path = realpath($qrcode_dir); |
| 66 | 66 | } else { |
| 67 | - $qrcode_dir = dirname(dirname(dirname(__FILE__))) . '/phpqrcode'; |
|
| 67 | + $qrcode_dir = dirname(dirname(dirname(__FILE__))).'/phpqrcode'; |
|
| 68 | 68 | $qrcode_path = $qrcode_dir; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if (is_dir($qrcode_path)) { |
| 72 | 72 | $this->qrcodePath = $qrcode_path; |
| 73 | 73 | } else { |
| 74 | - throw new Exception('Directory not found: ' . var_export($qrcode_dir, TRUE)); |
|
| 74 | + throw new Exception('Directory not found: '.var_export($qrcode_dir, TRUE)); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | if (isset($options["zend.path"])) { |
| 78 | 78 | $zend_dir = $options["zend.path"]; |
| 79 | 79 | $zend_path = realpath($zend_dir); |
| 80 | 80 | } else { |
| 81 | - $zend_dir = dirname(dirname(dirname(__FILE__))) . "/zend"; |
|
| 81 | + $zend_dir = dirname(dirname(dirname(__FILE__)))."/zend"; |
|
| 82 | 82 | $zend_path = $zend_dir; |
| 83 | 83 | } |
| 84 | 84 | if (is_dir($zend_path)) { |
| 85 | 85 | $this->zendPath = $zend_path; |
| 86 | 86 | } else { |
| 87 | - throw new Exception('Directory not found: ' . var_export($zend_dir, TRUE)); |
|
| 87 | + throw new Exception('Directory not found: '.var_export($zend_dir, TRUE)); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |