From 48288378ea06d25688e509f486a585439ae76998 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 25 Dec 2012 02:22:58 +0700 Subject: [PATCH 1/2] remove trailing_spaces --- src/PublicKey/Rsa.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PublicKey/Rsa.php b/src/PublicKey/Rsa.php index c755e0a..c6e8e32 100644 --- a/src/PublicKey/Rsa.php +++ b/src/PublicKey/Rsa.php @@ -166,7 +166,7 @@ public function sign($data, Rsa\PrivateKey $privateKey = null) if ($this->options->getBinaryOutput()) { return $signature; } - + return base64_encode($signature); } @@ -229,7 +229,7 @@ public function encrypt($data, Rsa\AbstractKey $key = null) if ($this->options->getBinaryOutput()) { return $encrypted; } - + return base64_encode($encrypted); } From 062568ccc67f863e85097ed8bdcb8447555c4d1e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 5 Jan 2013 05:43:48 +0700 Subject: [PATCH 2/2] boolean to bool in docblock --- src/BlockCipher.php | 10 +++++----- src/Hash.php | 6 +++--- src/Hmac.php | 6 +++--- src/Password/Bcrypt.php | 2 +- src/Password/PasswordInterface.php | 2 +- src/PublicKey/DiffieHellman.php | 4 ++-- src/PublicKey/RsaOptions.php | 4 ++-- src/Utils.php | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/BlockCipher.php b/src/BlockCipher.php index da51d9f..a29cce4 100644 --- a/src/BlockCipher.php +++ b/src/BlockCipher.php @@ -57,7 +57,7 @@ class BlockCipher /** * The output is binary? * - * @var boolean + * @var bool */ protected $binaryOutput = false; @@ -213,7 +213,7 @@ public function getSalt() /** * Enable/disable the binary output * - * @param boolean $value + * @param bool $value * @return BlockCipher */ public function setBinaryOutput($value) @@ -225,7 +225,7 @@ public function setBinaryOutput($value) /** * Get the value of binary output * - * @return boolean + * @return bool */ public function getBinaryOutput() { @@ -281,7 +281,7 @@ public function setCipherAlgorithm($algo) /** * Get the cipher algorithm * - * @return string|boolean + * @return string|bool */ public function getCipherAlgorithm() { @@ -383,7 +383,7 @@ public function encrypt($data) * Decrypt * * @param string $data - * @return string|boolean + * @return string|bool * @throws Exception\InvalidArgumentException */ public function decrypt($data) diff --git a/src/Hash.php b/src/Hash.php index e6f9475..8c27068 100644 --- a/src/Hash.php +++ b/src/Hash.php @@ -29,7 +29,7 @@ class Hash /** * @param string $hash * @param string $data - * @param boolean $output + * @param bool $output * @throws Exception\InvalidArgumentException * @return string */ @@ -48,7 +48,7 @@ public static function compute($hash, $data, $output = self::OUTPUT_STRING) * Get the output size according to the hash algorithm and the output format * * @param string $hash - * @param boolean $output + * @param bool $output * @return integer */ public static function getOutputSize($hash, $output = self::OUTPUT_STRING) @@ -70,7 +70,7 @@ public static function getSupportedAlgorithms() * Is the hash algorithm supported? * * @param string $algorithm - * @return boolean + * @return bool */ public static function isSupported($algorithm) { diff --git a/src/Hmac.php b/src/Hmac.php index 5ff23ef..e3dd4de 100644 --- a/src/Hmac.php +++ b/src/Hmac.php @@ -36,7 +36,7 @@ class Hmac * @param string $key * @param string $hash * @param string $data - * @param boolean $output + * @param bool $output * @throws Exception\InvalidArgumentException * @return string */ @@ -59,7 +59,7 @@ public static function compute($key, $hash, $data, $output = self::OUTPUT_STRING * Get the output size according to the hash algorithm and the output format * * @param string $hash - * @param boolean $output + * @param bool $output * @return integer */ public static function getOutputSize($hash, $output = self::OUTPUT_STRING) @@ -81,7 +81,7 @@ public static function getSupportedAlgorithms() * Is the hash algorithm supported? * * @param string $algorithm - * @return boolean + * @return bool */ public static function isSupported($algorithm) { diff --git a/src/Password/Bcrypt.php b/src/Password/Bcrypt.php index e8dc522..84de75a 100644 --- a/src/Password/Bcrypt.php +++ b/src/Password/Bcrypt.php @@ -107,7 +107,7 @@ public function create($password) * * @param string $password * @param string $hash - * @return boolean + * @return bool */ public function verify($password, $hash) { diff --git a/src/Password/PasswordInterface.php b/src/Password/PasswordInterface.php index 122f4ef..daad873 100644 --- a/src/Password/PasswordInterface.php +++ b/src/Password/PasswordInterface.php @@ -25,7 +25,7 @@ public function create($password); * * @param string $password The password to hash * @param string $hash The supplied hash to validate - * @return boolean Does the password validate against the hash + * @return bool Does the password validate against the hash */ public function verify($password, $hash); } diff --git a/src/PublicKey/DiffieHellman.php b/src/PublicKey/DiffieHellman.php index 61c9e13..c983a36 100644 --- a/src/PublicKey/DiffieHellman.php +++ b/src/PublicKey/DiffieHellman.php @@ -36,7 +36,7 @@ class DiffieHellman * Static flag to select whether to use PHP5.3's openssl extension * if available. * - * @var boolean + * @var bool */ public static $useOpenssl = true; @@ -378,7 +378,7 @@ public function getPrivateKey($format = self::FORMAT_NUMBER) /** * Check whether a private key currently exists. * - * @return boolean + * @return bool */ public function hasPrivateKey() { diff --git a/src/PublicKey/RsaOptions.php b/src/PublicKey/RsaOptions.php index 136e5df..f43a4e9 100644 --- a/src/PublicKey/RsaOptions.php +++ b/src/PublicKey/RsaOptions.php @@ -166,7 +166,7 @@ public function getOpensslSignatureAlgorithm() /** * Enable/disable the binary output * - * @param boolean $value + * @param bool $value * @return RsaOptions */ public function setBinaryOutput($value) @@ -178,7 +178,7 @@ public function setBinaryOutput($value) /** * Get the value of binary output * - * @return boolean + * @return bool */ public function getBinaryOutput() { diff --git a/src/Utils.php b/src/Utils.php index a8c41d5..ef5ff29 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -28,7 +28,7 @@ class Utils * * @param string $expected * @param string $actual - * @return boolean + * @return bool */ public static function compareStrings($expected, $actual) {