From f40ea062c2a84cce03d0f00d08043d7fd5ab1a39 Mon Sep 17 00:00:00 2001 From: Sokolovskyy Roman Date: Wed, 25 Oct 2017 11:44:14 +0200 Subject: [PATCH] Lots of PHPDoc fixes --- phpseclib/Common/Functions/Objects.php | 6 +- phpseclib/Common/Functions/Strings.php | 6 +- phpseclib/Crypt/Common/AsymmetricKey.php | 5 +- phpseclib/Crypt/Common/Keys/OpenSSH.php | 1 + phpseclib/Crypt/Common/Keys/PKCS8.php | 6 +- phpseclib/Crypt/Common/Keys/PuTTY.php | 2 - phpseclib/Crypt/DSA.php | 5 +- phpseclib/Crypt/DSA/Keys/PuTTY.php | 3 - phpseclib/Crypt/DSA/Keys/Raw.php | 3 - phpseclib/Crypt/DSA/Signature/PKCS.php | 2 +- phpseclib/Crypt/Hash.php | 3 +- phpseclib/Crypt/RC2.php | 2 +- phpseclib/Crypt/RC4.php | 7 +- phpseclib/Crypt/RSA.php | 22 +++--- phpseclib/Crypt/Random.php | 2 +- phpseclib/Crypt/Rijndael.php | 1 + phpseclib/File/ANSI.php | 6 +- phpseclib/File/ASN1.php | 7 +- phpseclib/File/X509.php | 11 ++- phpseclib/Math/BigInteger.php | 58 ++++++++++----- phpseclib/Math/BigInteger/Engines/BCMath.php | 69 +++++++++++++----- .../BigInteger/Engines/BCMath/BuiltIn.php | 5 +- .../Engines/BCMath/Reductions/EvalBarrett.php | 2 +- phpseclib/Math/BigInteger/Engines/Engine.php | 27 ++++--- phpseclib/Math/BigInteger/Engines/GMP.php | 73 +++++++++++++------ .../BigInteger/Engines/GMP/DefaultEngine.php | 5 +- phpseclib/Math/BigInteger/Engines/OpenSSL.php | 5 +- phpseclib/Math/BigInteger/Engines/PHP.php | 31 ++++++-- .../Engines/PHP/Reductions/EvalBarrett.php | 5 +- phpseclib/Math/BigInteger/Engines/PHP32.php | 59 +++++++++++---- phpseclib/Math/BigInteger/Engines/PHP64.php | 59 +++++++++++---- phpseclib/Net/SCP.php | 3 +- phpseclib/Net/SFTP.php | 9 ++- phpseclib/Net/SFTP/Stream.php | 1 - phpseclib/Net/SSH1.php | 7 +- phpseclib/Net/SSH2.php | 12 ++- phpseclib/System/SSH/Agent/Identity.php | 2 +- 37 files changed, 356 insertions(+), 176 deletions(-) diff --git a/phpseclib/Common/Functions/Objects.php b/phpseclib/Common/Functions/Objects.php index 607e0181..a3cec551 100644 --- a/phpseclib/Common/Functions/Objects.php +++ b/phpseclib/Common/Functions/Objects.php @@ -26,7 +26,7 @@ abstract class Objects /** * Accesses a private variable from an object * - * @param Object $obj + * @param object $obj * @param string $var * @return mixed * @access public @@ -42,7 +42,7 @@ abstract class Objects /** * Sets the value of a private variable in an object * - * @param Object $obj + * @param object $obj * @param string $var * @param mixed $val * @access public @@ -58,7 +58,7 @@ abstract class Objects /** * Accesses a private method from an object * - * @param Object $obj + * @param object $obj * @param string $func * @param array $params * @return mixed diff --git a/phpseclib/Common/Functions/Strings.php b/phpseclib/Common/Functions/Strings.php index 8a7ca87e..dc869109 100644 --- a/phpseclib/Common/Functions/Strings.php +++ b/phpseclib/Common/Functions/Strings.php @@ -103,10 +103,10 @@ abstract class Strings * * uint64 is not supported. * - * @param string $string - * @param int $index - * @access public + * @param string $format + * @param $data * @return mixed + * @access public */ public static function unpackSSH2($format, $data) { diff --git a/phpseclib/Crypt/Common/AsymmetricKey.php b/phpseclib/Crypt/Common/AsymmetricKey.php index 8bf4f8b7..e805c4ec 100644 --- a/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/phpseclib/Crypt/Common/AsymmetricKey.php @@ -180,6 +180,7 @@ abstract class AsymmetricKey /** * Tests engine validity * + * @returns boolean * @access public * @param int $val */ @@ -254,8 +255,8 @@ abstract class AsymmetricKey /** * Load Plugins * - * @params $format * @access private + * @param $format */ private static function loadPlugins($format) { @@ -539,7 +540,7 @@ abstract class AsymmetricKey * @see self::createKey() * @see self::load() * @access public - * @param string $password + * @param string|boolean $password */ public function setPassword($password = false) { diff --git a/phpseclib/Crypt/Common/Keys/OpenSSH.php b/phpseclib/Crypt/Common/Keys/OpenSSH.php index fc7fc822..2a030361 100644 --- a/phpseclib/Crypt/Common/Keys/OpenSSH.php +++ b/phpseclib/Crypt/Common/Keys/OpenSSH.php @@ -103,6 +103,7 @@ abstract class OpenSSH * Returns the comment for the key * * @access public + * @param $key * @return mixed */ public static function getComment($key) diff --git a/phpseclib/Crypt/Common/Keys/PKCS8.php b/phpseclib/Crypt/Common/Keys/PKCS8.php index e4002fe7..e9bfe3d4 100644 --- a/phpseclib/Crypt/Common/Keys/PKCS8.php +++ b/phpseclib/Crypt/Common/Keys/PKCS8.php @@ -28,6 +28,7 @@ namespace phpseclib\Crypt\Common\Keys; use ParagonIE\ConstantTime\Base64; +use phpseclib\Crypt\Common\SymmetricKey; use phpseclib\Crypt\DES; use phpseclib\Crypt\RC2; use phpseclib\Crypt\RC4; @@ -138,7 +139,7 @@ abstract class PKCS8 extends PKCS /** * Returns a SymmetricKey object based on a PBES1 $algo - * + * @returns SymmetricKey * @access public * @param string $algo */ @@ -188,6 +189,7 @@ abstract class PKCS8 extends PKCS /** * Returns a hash based on a PBES1 $algo * + * @returns string * @access public * @param string $algo */ @@ -203,6 +205,7 @@ abstract class PKCS8 extends PKCS /** * Returns a KDF baesd on a PBES1 $algo * + * @returns string * @access public * @param string $algo */ @@ -224,6 +227,7 @@ abstract class PKCS8 extends PKCS /** * Returns a SymmetricKey object baesd on a PBES2 $algo * + * @returns SymmetricKey * @access public * @param string $algo */ diff --git a/phpseclib/Crypt/Common/Keys/PuTTY.php b/phpseclib/Crypt/Common/Keys/PuTTY.php index 44224510..d6618f44 100644 --- a/phpseclib/Crypt/Common/Keys/PuTTY.php +++ b/phpseclib/Crypt/Common/Keys/PuTTY.php @@ -74,8 +74,6 @@ abstract class PuTTY * * @access public * @param string $key - * @param string $publicHandler - * @param string $type * @param string $password * @return array|bool */ diff --git a/phpseclib/Crypt/DSA.php b/phpseclib/Crypt/DSA.php index 19b0bae2..801ac7fc 100644 --- a/phpseclib/Crypt/DSA.php +++ b/phpseclib/Crypt/DSA.php @@ -213,10 +213,10 @@ class DSA extends AsymmetricKey * Loads a public or private key * * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed) - * + * @return boolean * @access public * @param string $key - * @param int $type optional + * @param int|boolean $type optional */ public function load($key, $type = false) { @@ -460,6 +460,7 @@ class DSA extends AsymmetricKey * @see self::verify() * @access public * @param string $message + * @param $signature * @param string $format optional * @return mixed */ diff --git a/phpseclib/Crypt/DSA/Keys/PuTTY.php b/phpseclib/Crypt/DSA/Keys/PuTTY.php index af7a7ea4..1decb1e5 100644 --- a/phpseclib/Crypt/DSA/Keys/PuTTY.php +++ b/phpseclib/Crypt/DSA/Keys/PuTTY.php @@ -90,9 +90,6 @@ abstract class PuTTY extends Progenitor * @param \phpseclib\Math\BigInteger $g * @param \phpseclib\Math\BigInteger $y * @param \phpseclib\Math\BigInteger $x - * @param array $primes - * @param array $exponents - * @param array $coefficients * @param string $password optional * @return string */ diff --git a/phpseclib/Crypt/DSA/Keys/Raw.php b/phpseclib/Crypt/DSA/Keys/Raw.php index ab6085fa..7adbb363 100644 --- a/phpseclib/Crypt/DSA/Keys/Raw.php +++ b/phpseclib/Crypt/DSA/Keys/Raw.php @@ -67,9 +67,6 @@ abstract class Raw * @param \phpseclib\Math\BigInteger $g * @param \phpseclib\Math\BigInteger $y * @param \phpseclib\Math\BigInteger $x - * @param array $primes - * @param array $exponents - * @param array $coefficients * @param string $password optional * @return string */ diff --git a/phpseclib/Crypt/DSA/Signature/PKCS.php b/phpseclib/Crypt/DSA/Signature/PKCS.php index eeb97755..1d4979f5 100644 --- a/phpseclib/Crypt/DSA/Signature/PKCS.php +++ b/phpseclib/Crypt/DSA/Signature/PKCS.php @@ -35,7 +35,7 @@ abstract class PKCS * Loads a signature * * @access public - * @param array $key + * @param $sig * @return array|bool */ public static function load($sig) diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 2b4f7b83..a24df6d8 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -331,9 +331,10 @@ class Hash /** * Pure-PHP implementation of SHA512 - * * @access private * @param string $m + * @param $hash + * @return string */ private static function sha512($m, $hash) { diff --git a/phpseclib/Crypt/RC2.php b/phpseclib/Crypt/RC2.php index 013b32ec..d714e58a 100644 --- a/phpseclib/Crypt/RC2.php +++ b/phpseclib/Crypt/RC2.php @@ -344,7 +344,7 @@ class RC2 extends BlockCipher * @see \phpseclib\Crypt\Common\SymmetricKey::setKey() * @access public * @param string $key - * @param int $t1 optional Effective key length in bits. + * @param int|boolean $t1 optional Effective key length in bits. * @throws \LengthException if the key length isn't supported */ public function setKey($key, $t1 = false) diff --git a/phpseclib/Crypt/RC4.php b/phpseclib/Crypt/RC4.php index e2d8b24e..8f5262fa 100644 --- a/phpseclib/Crypt/RC4.php +++ b/phpseclib/Crypt/RC4.php @@ -204,8 +204,7 @@ class RC4 extends StreamCipher * Keys can be between 1 and 256 bytes long. * * @access public - * @param int $length - * @throws \LengthException if the key length is invalid + * @param string $key */ public function setKey($key) { @@ -256,7 +255,7 @@ class RC4 extends StreamCipher /** * Encrypts a block - * + * @return null * @access private * @param string $in */ @@ -267,7 +266,7 @@ class RC4 extends StreamCipher /** * Decrypts a block - * + * @return null * @access private * @param string $in */ diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index e931267d..27a87cd1 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -320,9 +320,10 @@ class RSA extends AsymmetricKey * - 'privatekey': The private key. * - 'publickey': The public key. * + * @return array * @access public * @param int $bits - * @param array $p + * */ public static function createKey($bits = 2048) { @@ -455,9 +456,10 @@ class RSA extends AsymmetricKey * * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed) * + * @return boolean * @access public * @param string $key - * @param int $type optional + * @param int|boolean $type optional */ public function load($key, $type = false) { @@ -652,8 +654,8 @@ class RSA extends AsymmetricKey * * @see self::getPublicKey() * @access public - * @param string $key optional - * @param int $type optional + * @param string|boolean $key optional + * @param int|boolean $type optional * @return bool */ public function setPublicKey($key = false, $type = false) @@ -696,8 +698,8 @@ class RSA extends AsymmetricKey * * @see self::getPublicKey() * @access public - * @param string $key optional - * @param int $type optional + * @param string|boolean $key optional + * @param int|boolean $type optional * @return bool */ public function setPrivateKey($key = false, $type = false) @@ -836,7 +838,8 @@ class RSA extends AsymmetricKey * of the hash function Hash) and 0. * * @access public - * @param int $format + * @param $sLen + * @internal param int $format */ public function setSaltLength($sLen) { @@ -1079,7 +1082,7 @@ class RSA extends AsymmetricKey * * @access private * @param string $mgfSeed - * @param int $mgfLen + * @param int $maskLen * @return string */ private function mgf1($mgfSeed, $maskLen) @@ -1345,6 +1348,7 @@ class RSA extends AsymmetricKey * * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}. * + * @returns string * @access private * @param string $m * @throws \RuntimeException on encoding error @@ -1740,7 +1744,7 @@ class RSA extends AsymmetricKey * * @see self::encrypt() * @access public - * @param string $plaintext + * @param string $ciphertext * @param int $padding optional * @return bool|string */ diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index cc1f568d..188b6fae 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -190,7 +190,7 @@ abstract class Random * Safely serialize variables * * If a class has a private __sleep() it'll emit a warning - * + * @return mixed * @param mixed $arr * @access public */ diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 1553bb09..bc1eb963 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -604,6 +604,7 @@ class Rijndael extends BlockCipher /** * Performs S-Box substitutions * + * @returns array * @access private * @param int $word */ diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 6c42ef1f..891f61cf 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -203,8 +203,7 @@ class ANSI /** * Set the number of lines that should be logged past the terminal height * - * @param int $x - * @param int $y + * @param $history * @access public */ public function setHistory($history) @@ -461,6 +460,9 @@ class ANSI * Returns the current coordinate without preformating * * @access private + * @param $last_attr + * @param $cur_attr + * @param $char * @return string */ private function processCoordinate($last_attr, $cur_attr, $char) diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 1a8c02d9..8bf4511a 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -814,8 +814,8 @@ abstract class ASN1 * "Special" mappings can be applied via $special. * * @param string $source - * @param string $mapping - * @param int $idx + * @param array $mapping + * @param array $special * @return string * @access public */ @@ -831,8 +831,8 @@ abstract class ASN1 * @param string $source * @param array $mapping * @param int $idx + * @param array $special * @return string - * @throws \RuntimeException if the input has an error in it * @access private */ private static function encode_der($source, $mapping, $idx = null, $special = []) @@ -1387,6 +1387,7 @@ abstract class ASN1 * getOID('zzz') == 'zzz' * * @access public + * @param $name * @return string */ static function getOID($name) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 0fd6826e..9dd55af0 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -1924,8 +1924,9 @@ class X509 * Load a Certificate Signing Request * * @param string $csr - * @access public + * @param int $mode * @return mixed + * @access public */ public function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT) { @@ -2162,8 +2163,9 @@ class X509 * Load a Certificate Revocation List * * @param string $crl - * @access public + * @param int $mode * @return mixed + * @access public */ public function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT) { @@ -2496,6 +2498,7 @@ class X509 * Sign a CSR * * @access public + * @param string $signatureAlgorithm * @return mixed */ public function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption') @@ -2554,6 +2557,7 @@ class X509 * Sign a SPKAC * * @access public + * @param string $signatureAlgorithm * @return mixed */ public function signSPKAC($signatureAlgorithm = 'sha1WithRSAEncryption') @@ -2752,7 +2756,6 @@ class X509 * X.509 certificate signing helper function. * * @param object $key - * @param \phpseclib\File\X509 $subject * @param string $signatureAlgorithm * @access public * @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported @@ -3297,7 +3300,7 @@ class X509 * * @param string $id * @param mixed $value - * @param bool $disposition optional + * @param int $disposition optional * @access public * @return bool */ diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index bcc99e10..ad03bf99 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -76,7 +76,7 @@ class BigInteger implements \Serializable * Throws an exception if the type is invalid * * @param string $main - * @param array $modexp optional + * @param array $modexps optional */ public static function setEngine($main, $modexps = ['DefaultEngine']) { @@ -219,7 +219,8 @@ class BigInteger implements \Serializable /** * Adds two BigIntegers. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $y + * @return BigInteger */ public function add(BigInteger $y) { @@ -229,7 +230,8 @@ class BigInteger implements \Serializable /** * Subtracts two BigIntegers. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $y + * @return BigInteger */ function subtract(BigInteger $y) { @@ -270,7 +272,7 @@ class BigInteger implements \Serializable * * * @param \phpseclib\Math\BigInteger $y - * @return \phpseclib\Math\BigInteger + * @return \phpseclib\Math\BigInteger[] */ public function divide(BigInteger $y) { @@ -285,7 +287,7 @@ class BigInteger implements \Serializable * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. - * + * @return BigInteger * @param \phpseclib\Math\BigInteger $n */ public function modInverse(BigInteger $n) @@ -297,7 +299,7 @@ class BigInteger implements \Serializable * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. - * + * @return array * @param \phpseclib\Math\BigInteger $n */ public function extendedGCD(BigInteger $n) @@ -315,7 +317,8 @@ class BigInteger implements \Serializable * * Say you have 693 and 609. The GCD is 21. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $n + * @return BigInteger */ public function gcd(BigInteger $n) { @@ -402,7 +405,9 @@ class BigInteger implements \Serializable /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $e + * @param BigInteger $n + * @return BigInteger */ public function powMod(BigInteger $e, BigInteger $n) { @@ -412,7 +417,9 @@ class BigInteger implements \Serializable /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $e + * @param BigInteger $n + * @return BigInteger */ public function modPow(BigInteger $e, BigInteger $n) { @@ -447,6 +454,7 @@ class BigInteger implements \Serializable * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * + * @param BigInteger $x * @return bool */ public function equals(BigInteger $x) @@ -467,7 +475,8 @@ class BigInteger implements \Serializable /** * Logical And * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ public function bitwise_and(BigInteger $x) { @@ -477,7 +486,8 @@ class BigInteger implements \Serializable /** * Logical Or * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ public function bitwise_or(BigInteger $x) { @@ -487,7 +497,8 @@ class BigInteger implements \Serializable /** * Logical Exlusive Or * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ public function bitwise_xor(BigInteger $x) { @@ -615,7 +626,9 @@ class BigInteger implements \Serializable * * If there's not a prime within the given range, false will be returned. * - * @return \phpseclib\Math\BigInteger|false + * @param BigInteger $min + * @param BigInteger $max + * @return false|BigInteger */ public static function randomRangePrime(BigInteger $min, BigInteger $max) { @@ -632,7 +645,9 @@ class BigInteger implements \Serializable * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $min + * @param BigInteger $max + * @return BigInteger */ public static function randomRange(BigInteger $min, BigInteger $max) { @@ -647,7 +662,7 @@ class BigInteger implements \Serializable * $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads * on a website instead of just one. * - * @param int $t + * @param int|boolean $t * @return bool */ public function isPrime($t = false) @@ -671,7 +686,8 @@ class BigInteger implements \Serializable /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger $n + * @return BigInteger */ public function pow(BigInteger $n) { @@ -681,7 +697,8 @@ class BigInteger implements \Serializable /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger[] $nums + * @return BigInteger */ public static function min(BigInteger ...$nums) { @@ -693,7 +710,8 @@ class BigInteger implements \Serializable /** * Return the maximum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger + * @param BigInteger[] $nums + * @return BigInteger */ public static function max(BigInteger ...$nums) { @@ -705,7 +723,9 @@ class BigInteger implements \Serializable /** * Tests BigInteger to see if it is between two integers, inclusive * - * @return boolean + * @param BigInteger $min + * @param BigInteger $max + * @return bool */ public function between(BigInteger $min, BigInteger $max) { diff --git a/phpseclib/Math/BigInteger/Engines/BCMath.php b/phpseclib/Math/BigInteger/Engines/BCMath.php index 3d2ab07d..bb30735c 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -204,7 +204,8 @@ class BCMath extends Engine /** * Adds two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $y + * @return BCMath */ public function add(BCMath $y) { @@ -217,7 +218,8 @@ class BCMath extends Engine /** * Subtracts two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $y + * @return BCMath */ public function subtract(BCMath $y) { @@ -230,7 +232,8 @@ class BCMath extends Engine /** * Multiplies two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $x + * @return BCMath */ public function multiply(BCMath $x) { @@ -248,7 +251,8 @@ class BCMath extends Engine * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $y + * @return BCMath */ public function divide(BCMath $y) { @@ -270,6 +274,7 @@ class BCMath extends Engine * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * + * @returns Engine|boolean * @param \phpseclib\Math\BigInteger\Engines\BCMath $n */ public function modInverse(BCMath $n) @@ -285,7 +290,8 @@ class BCMath extends Engine * combination is returned is dependent upon which mode is in use. See * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $n + * @return BCMath */ public function extendedGCD(BCMath $n) { @@ -329,7 +335,8 @@ class BCMath extends Engine * * Say you have 693 and 609. The GCD is 21. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $n + * @return BCMath */ public function gcd(BCMath $n) { @@ -355,7 +362,8 @@ class BCMath extends Engine /** * Logical And * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $x + * @return BCMath */ public function bitwise_and(BCMath $x) { @@ -373,7 +381,8 @@ class BCMath extends Engine /** * Logical Or * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $x + * @return BCMath */ public function bitwise_or(BCMath $x) { @@ -391,7 +400,8 @@ class BCMath extends Engine /** * Logical Exlusive Or * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $x + * @return BCMath */ public function bitwise_xor(BCMath $x) { @@ -450,7 +460,7 @@ class BCMath extends Engine * * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * - * @param \phpseclib\Math\BigInteger $y + * @param BCMath $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @see self::equals() * @internal Could return $this->subtract($x), but that's not as fast as what we do do. @@ -465,6 +475,7 @@ class BCMath extends Engine * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * + * @param BCMath $x * @return bool */ public function equals(BCMath $x) @@ -475,7 +486,9 @@ class BCMath extends Engine /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $e + * @param BCMath $n + * @return BCMath */ public function modPow(BCMath $e, BCMath $n) { @@ -487,7 +500,9 @@ class BCMath extends Engine * * Alias for modPow(). * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $e + * @param BCMath $n + * @return BCMath */ public function powMod(BCMath $e, BCMath $n) { @@ -497,7 +512,9 @@ class BCMath extends Engine /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $e + * @param BCMath $n + * @return BCMath */ protected function powModInner(BCMath $e, BCMath $n) { @@ -514,7 +531,8 @@ class BCMath extends Engine * * Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $result + * @return BCMath */ protected function normalize(BCMath $result) { @@ -533,7 +551,9 @@ class BCMath extends Engine * * If there's not a prime within the given range, false will be returned. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath|false + * @param BCMath $min + * @param BCMath $max + * @return false|BCMath */ public static function randomRangePrime(BCMath $min, BCMath $max) { @@ -549,7 +569,9 @@ class BCMath extends Engine * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $min + * @param BCMath $max + * @return BCMath */ public static function randomRange(BCMath $min, BCMath $max) { @@ -605,6 +627,7 @@ class BCMath extends Engine * ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s)); * * @see self::isPrime() + * @param $r * @return int */ protected static function scan1divide($r) @@ -623,7 +646,8 @@ class BCMath extends Engine /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $n + * @return BCMath */ public function pow(BCMath $n) { @@ -636,7 +660,8 @@ class BCMath extends Engine /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath[] $nums + * @return BCMath */ public static function min(BCMath ...$nums) { @@ -646,7 +671,8 @@ class BCMath extends Engine /** * Return the maximum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath[] $nums + * @return BCMath */ public static function max(BCMath ...$nums) { @@ -656,7 +682,9 @@ class BCMath extends Engine /** * Tests BigInteger to see if it is between two integers, inclusive * - * @return boolean + * @param BCMath $min + * @param BCMath $max + * @return bool */ public function between(BCMath $min, BCMath $max) { @@ -666,6 +694,7 @@ class BCMath extends Engine /** * Set Bitmask * + * @returns Engine * @param int $bits * @see self::setPrecision() */ diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php b/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php index 8cf0de23..cb9ed1c4 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php @@ -29,7 +29,10 @@ abstract class BuiltIn extends BCMath /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @param BCMath $x + * @param BCMath $e + * @param BCMath $n + * @return BCMath */ protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n) { diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php index 58374b3d..ae1e896a 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php @@ -53,7 +53,7 @@ abstract class EvalBarrett extends Base /** * Generate Custom Reduction * - * @param array $m + * @param BCMath $m * @param string $class * @return callable|void */ diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 3abdbc65..ca9fea14 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -61,7 +61,6 @@ abstract class Engine implements \Serializable * * @param $x integer Base-10 number or base-$base number if $base set. * @param int $base - * @return \phpseclib\Math\BigInteger\Engines\Engine */ public function __construct($x, $base) { @@ -194,8 +193,6 @@ abstract class Engine implements \Serializable * * Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're * saved as two's compliment. - * - * @param bool $twos_compliment * @return string */ protected function toBytesHelper() @@ -384,7 +381,7 @@ abstract class Engine implements \Serializable /** * Set Bitmask - * + * @returns Engine * @param int $bits * @see self::setPrecision() */ @@ -563,6 +560,8 @@ abstract class Engine implements \Serializable /** * Performs some pre-processing for powMod * + * @param Engine $e + * @param Engine $n * @return bool|Engine */ protected function powModOuter(Engine $e, Engine $n) @@ -691,6 +690,8 @@ abstract class Engine implements \Serializable /** * Performs some pre-processing for randomRangePrime * + * @param Engine $min + * @param Engine $max * @return bool|Engine */ protected static function randomRangePrimeOuter(Engine $min, Engine $max) @@ -720,7 +721,9 @@ abstract class Engine implements \Serializable * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @param Engine $min + * @param Engine $max + * @return Engine */ protected static function randomRangeHelper(Engine $min, Engine $max) { @@ -781,6 +784,9 @@ abstract class Engine implements \Serializable /** * Performs some post-processing for randomRangePrime * + * @param Engine $x + * @param Engine $min + * @param Engine $max * @return bool|Engine */ protected static function randomRangePrimeInner(Engine $x, Engine $min, Engine $max) @@ -900,7 +906,7 @@ abstract class Engine implements \Serializable * $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads * on a website instead of just one. * - * @param int $t + * @param int|boolean $t * @return bool */ public function isPrime($t = false) @@ -996,7 +1002,8 @@ abstract class Engine implements \Serializable /** * Calculates the nth root of a biginteger. * - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @param int $n + * @return Engine */ public function root($n = 2) { @@ -1006,7 +1013,8 @@ abstract class Engine implements \Serializable /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @param array $nums + * @return Engine */ protected static function minHelper(array $nums) { @@ -1023,7 +1031,8 @@ abstract class Engine implements \Serializable /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @param array $nums + * @return Engine */ protected static function maxHelper(array $nums) { diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index 9f13f254..fbc4cf9e 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -186,7 +186,8 @@ class GMP extends Engine /** * Adds two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $y + * @return GMP */ public function add(GMP $y) { @@ -199,7 +200,8 @@ class GMP extends Engine /** * Subtracts two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $y + * @return GMP */ public function subtract(GMP $y) { @@ -212,7 +214,8 @@ class GMP extends Engine /** * Multiplies two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $x + * @return GMP */ public function multiply(GMP $x) { @@ -230,7 +233,8 @@ class GMP extends Engine * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $y + * @return GMP */ public function divide(GMP $y) { @@ -258,6 +262,7 @@ class GMP extends Engine * * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * + * @param GMP $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @access public * @see self::equals() @@ -273,6 +278,7 @@ class GMP extends Engine * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * + * @param GMP $x * @return bool */ public function equals(GMP $x) @@ -285,7 +291,8 @@ class GMP extends Engine * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * - * @return \phpseclib\Math\BigInteger\Engines\GMP|false + * @param GMP $n + * @return false|GMP */ public function modInverse(GMP $n) { @@ -322,7 +329,8 @@ class GMP extends Engine * * Say you have 693 and 609. The GCD is 21. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $n + * @return GMP */ public function gcd(GMP $n) { @@ -347,7 +355,8 @@ class GMP extends Engine /** * Logical And * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $x + * @return GMP */ public function bitwise_and(GMP $x) { @@ -360,7 +369,8 @@ class GMP extends Engine /** * Logical Or * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $x + * @return GMP */ public function bitwise_or(GMP $x) { @@ -373,7 +383,8 @@ class GMP extends Engine /** * Logical Exclusive Or * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $x + * @return GMP */ public function bitwise_xor(GMP $x) { @@ -421,7 +432,9 @@ class GMP extends Engine /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $e + * @param GMP $n + * @return GMP */ public function modPow(GMP $e, GMP $n) { @@ -433,7 +446,9 @@ class GMP extends Engine * * Alias for modPow(). * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $e + * @param GMP $n + * @return GMP */ public function powMod(GMP $e, GMP $n) { @@ -443,7 +458,9 @@ class GMP extends Engine /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $e + * @param GMP $n + * @return GMP */ protected function powModInner(GMP $e, GMP $n) { @@ -456,7 +473,8 @@ class GMP extends Engine * * Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $result + * @return GMP */ protected function normalize(GMP $result) { @@ -473,7 +491,10 @@ class GMP extends Engine /** * Performs some post-processing for randomRangePrime * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param Engine $x + * @param Engine $min + * @param Engine $max + * @return GMP */ protected static function randomRangePrimeInner(Engine $x, Engine $min, Engine $max) { @@ -495,7 +516,9 @@ class GMP extends Engine * * If there's not a prime within the given range, false will be returned. * - * @return \phpseclib\Math\BigInteger\Engines\GMP|false + * @param GMP $min + * @param GMP $max + * @return false|GMP */ public static function randomRangePrime(GMP $min, GMP $max) { @@ -511,7 +534,9 @@ class GMP extends Engine * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $min + * @param GMP $max + * @return GMP */ public static function randomRange(GMP $min, GMP $max) { @@ -546,7 +571,8 @@ class GMP extends Engine * * Returns the nth root of a positive biginteger, where n defaults to 2 * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param int $n + * @return GMP */ protected function rootInner($n) { @@ -558,7 +584,8 @@ class GMP extends Engine /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $n + * @return GMP */ public function pow(GMP $n) { @@ -571,7 +598,8 @@ class GMP extends Engine /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP[] $nums + * @return GMP */ public static function min(GMP ...$nums) { @@ -581,7 +609,8 @@ class GMP extends Engine /** * Return the maximum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP[] $nums + * @return GMP */ public static function max(GMP ...$nums) { @@ -591,7 +620,9 @@ class GMP extends Engine /** * Tests BigInteger to see if it is between two integers, inclusive * - * @return boolean + * @param GMP $min + * @param GMP $max + * @return bool */ public function between(GMP $min, GMP $max) { diff --git a/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php b/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php index c1b0e594..553c6e43 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php +++ b/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php @@ -29,7 +29,10 @@ abstract class DefaultEngine extends GMP /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @param GMP $x + * @param GMP $e + * @param GMP $n + * @return GMP */ protected static function powModHelper(GMP $x, GMP $e, GMP $n) { diff --git a/phpseclib/Math/BigInteger/Engines/OpenSSL.php b/phpseclib/Math/BigInteger/Engines/OpenSSL.php index 93d216aa..6a1aed52 100644 --- a/phpseclib/Math/BigInteger/Engines/OpenSSL.php +++ b/phpseclib/Math/BigInteger/Engines/OpenSSL.php @@ -40,7 +40,10 @@ abstract class OpenSSL /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @param Engine $x + * @param Engine $e + * @param Engine $n + * @return Engine */ public static function powModHelper(Engine $x, Engine $e, Engine $n) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index 3ea67453..2133cc0d 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -141,6 +141,7 @@ abstract class PHP extends Engine /** * Pads strings so that unpack may be used on them * + * @param $str * @return string */ protected function pad($str) @@ -673,6 +674,7 @@ abstract class PHP extends Engine * * abc / x = a00 / x + b0 / x + c / x * + * @param array $dividend * @param int $divisor * @return array */ @@ -732,7 +734,8 @@ abstract class PHP extends Engine * * Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param $result + * @return PHP */ protected function normalize($result) { @@ -802,7 +805,8 @@ abstract class PHP extends Engine * combination is returned is dependent upon which mode is in use. See * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information. * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $n + * @return PHP[] * @internal Calculates the GCD using the binary xGCD algorithim described in * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=19 HAC 14.61}. As the text above 14.61 notes, * the more traditional algorithim requires "relatively costly multiple-precision divisions". @@ -886,7 +890,8 @@ abstract class PHP extends Engine /** * Logical And * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $x + * @return PHP */ protected function bitwiseAndHelper(PHP $x) { @@ -906,7 +911,8 @@ abstract class PHP extends Engine /** * Logical Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $x + * @return PHP */ protected function bitwiseOrHelper(PHP $x) { @@ -925,7 +931,8 @@ abstract class PHP extends Engine /** * Logical Exlusive Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $x + * @return PHP */ protected function bitwiseXorHelper(PHP $x) { @@ -946,7 +953,8 @@ abstract class PHP extends Engine * * Removes leading zeros * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param array $value + * @return PHP */ protected static function trim(array $value) { @@ -1144,7 +1152,9 @@ abstract class PHP extends Engine /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $e + * @param PHP $n + * @return PHP */ protected function powModInner(PHP $e, PHP $n) { @@ -1159,6 +1169,7 @@ abstract class PHP extends Engine /** * Performs squaring * + * @param array $x * @return array */ protected static function square(array $x) @@ -1175,6 +1186,7 @@ abstract class PHP extends Engine * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=7 HAC 14.2.4} / * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information. * + * @param array $value * @return array */ protected static function baseSquare(array $value) @@ -1212,6 +1224,7 @@ abstract class PHP extends Engine * See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}. * + * @param array $value * @return array */ protected static function karatsubaSquare(array $value) @@ -1288,6 +1301,7 @@ abstract class PHP extends Engine * ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s)); * * @see self::isPrime() + * @param $r * @return int */ protected static function scan1divide($r) @@ -1309,7 +1323,8 @@ abstract class PHP extends Engine /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @param PHP $n + * @return PHP */ protected function powHelper(PHP $n) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php index f34018f3..e2c7e707 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php @@ -444,10 +444,7 @@ abstract class EvalBarrett extends Base * If you do echo floatval(pow(2, 52)) you'll get 4.6116860184274E+18. It /can/ be displayed without a loss of * precision but displayed in this way there will be precision loss, hence the need for this method. * - * @param string $x - * @param string $y - * @param string $result - * @param string $class + * @param $num * @return string */ private static function float2string($num) diff --git a/phpseclib/Math/BigInteger/Engines/PHP32.php b/phpseclib/Math/BigInteger/Engines/PHP32.php index 17e77a2b..c5bc2312 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -106,7 +106,8 @@ class PHP32 extends PHP /** * Adds two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $y + * @return PHP32 */ public function add(PHP32 $y) { @@ -118,7 +119,8 @@ class PHP32 extends PHP /** * Subtracts two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $y + * @return PHP32 */ public function subtract(PHP32 $y) { @@ -130,7 +132,8 @@ class PHP32 extends PHP /** * Multiplies two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $y + * @return PHP32 */ public function multiply(PHP32 $y) { @@ -147,7 +150,8 @@ class PHP32 extends PHP * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $y + * @return PHP32 */ public function divide(PHP32 $y) { @@ -158,6 +162,8 @@ class PHP32 extends PHP * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. + * @param PHP32 $n + * @return false|Engine */ public function modInverse(PHP32 $n) { @@ -168,6 +174,8 @@ class PHP32 extends PHP * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. + * @param PHP32 $n + * @return PHP[] */ public function extendedGCD(PHP32 $n) { @@ -179,7 +187,8 @@ class PHP32 extends PHP * * Say you have 693 and 609. The GCD is 21. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $n + * @return PHP32 */ public function gcd(PHP32 $n) { @@ -190,7 +199,8 @@ class PHP32 extends PHP /** * Logical And * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $x + * @return PHP32 */ public function bitwise_and(PHP32 $x) { @@ -200,7 +210,8 @@ class PHP32 extends PHP /** * Logical Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $x + * @return PHP32 */ public function bitwise_or(PHP32 $x) { @@ -210,7 +221,8 @@ class PHP32 extends PHP /** * Logical Exlusive Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $x + * @return PHP32 */ public function bitwise_xor(PHP32 $x) { @@ -229,6 +241,7 @@ class PHP32 extends PHP * * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * + * @param PHP32 $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @access public * @see self::equals() @@ -244,6 +257,7 @@ class PHP32 extends PHP * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * + * @param PHP32 $x * @return bool */ public function equals(PHP32 $x) @@ -254,7 +268,9 @@ class PHP32 extends PHP /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $e + * @param PHP32 $n + * @return PHP32 */ public function modPow(PHP32 $e, PHP32 $n) { @@ -266,7 +282,9 @@ class PHP32 extends PHP * * Alias for modPow(). * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $e + * @param PHP32 $n + * @return PHP32 */ public function powMod(PHP32 $e, PHP32 $n) { @@ -278,7 +296,9 @@ class PHP32 extends PHP * * If there's not a prime within the given range, false will be returned. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32|false + * @param PHP32 $min + * @param PHP32 $max + * @return false|PHP32 */ public static function randomRangePrime(PHP32 $min, PHP32 $max) { @@ -294,7 +314,9 @@ class PHP32 extends PHP * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32 $min + * @param PHP32 $max + * @return PHP32 */ public static function randomRange(PHP32 $min, PHP32 $max) { @@ -304,7 +326,8 @@ class PHP32 extends PHP /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP32 $n + * @return PHP64 */ public function pow(PHP32 $n) { @@ -314,7 +337,8 @@ class PHP32 extends PHP /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32[] $nums + * @return PHP32 */ public static function min(PHP32 ...$nums) { @@ -324,7 +348,8 @@ class PHP32 extends PHP /** * Return the maximum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP32 + * @param PHP32[] $nums + * @return PHP32 */ public static function max(PHP32 ...$nums) { @@ -334,7 +359,9 @@ class PHP32 extends PHP /** * Tests BigInteger to see if it is between two integers, inclusive * - * @return boolean + * @param PHP32 $min + * @param PHP32 $max + * @return bool */ public function between(PHP32 $min, PHP32 $max) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP64.php b/phpseclib/Math/BigInteger/Engines/PHP64.php index 6c617100..f005a25e 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP64.php +++ b/phpseclib/Math/BigInteger/Engines/PHP64.php @@ -106,7 +106,8 @@ class PHP64 extends PHP /** * Adds two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $y + * @return PHP64 */ public function add(PHP64 $y) { @@ -118,7 +119,8 @@ class PHP64 extends PHP /** * Subtracts two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $y + * @return PHP64 */ public function subtract(PHP64 $y) { @@ -130,7 +132,8 @@ class PHP64 extends PHP /** * Multiplies two BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $y + * @return PHP64 */ public function multiply(PHP64 $y) { @@ -147,7 +150,8 @@ class PHP64 extends PHP * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $y + * @return PHP64 */ public function divide(PHP64 $y) { @@ -158,6 +162,8 @@ class PHP64 extends PHP * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. + * @param PHP64 $n + * @return false|Engine */ public function modInverse(PHP64 $n) { @@ -168,6 +174,8 @@ class PHP64 extends PHP * Calculates modular inverses. * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. + * @param PHP64 $n + * @return PHP[] */ public function extendedGCD(PHP64 $n) { @@ -179,7 +187,8 @@ class PHP64 extends PHP * * Say you have 693 and 609. The GCD is 21. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $n + * @return PHP64 */ public function gcd(PHP64 $n) { @@ -190,7 +199,8 @@ class PHP64 extends PHP /** * Logical And * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $x + * @return PHP64 */ public function bitwise_and(PHP64 $x) { @@ -200,7 +210,8 @@ class PHP64 extends PHP /** * Logical Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $x + * @return PHP64 */ public function bitwise_or(PHP64 $x) { @@ -210,7 +221,8 @@ class PHP64 extends PHP /** * Logical Exlusive Or * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $x + * @return PHP64 */ public function bitwise_xor(PHP64 $x) { @@ -229,6 +241,7 @@ class PHP64 extends PHP * * Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * + * @param PHP64 $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @access public * @see self::equals() @@ -244,6 +257,7 @@ class PHP64 extends PHP * * If you need to see if one number is greater than or less than another number, use BigInteger::compare() * + * @param PHP64 $x * @return bool */ public function equals(PHP64 $x) @@ -254,7 +268,9 @@ class PHP64 extends PHP /** * Performs modular exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $e + * @param PHP64 $n + * @return PHP64 */ public function modPow(PHP64 $e, PHP64 $n) { @@ -266,7 +282,9 @@ class PHP64 extends PHP * * Alias for modPow(). * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $e + * @param PHP64 $n + * @return PHP64 */ public function powMod(PHP64 $e, PHP64 $n) { @@ -278,7 +296,9 @@ class PHP64 extends PHP * * If there's not a prime within the given range, false will be returned. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64|false + * @param PHP64 $min + * @param PHP64 $max + * @return false|PHP64 */ public static function randomRangePrime(PHP64 $min, PHP64 $max) { @@ -294,7 +314,9 @@ class PHP64 extends PHP * BigInteger::randomRange($min, $max) * BigInteger::randomRange($max, $min) * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $min + * @param PHP64 $max + * @return PHP64 */ public static function randomRange(PHP64 $min, PHP64 $max) { @@ -304,7 +326,8 @@ class PHP64 extends PHP /** * Performs exponentiation. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64 $n + * @return PHP64 */ public function pow(PHP64 $n) { @@ -314,7 +337,8 @@ class PHP64 extends PHP /** * Return the minimum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64[] $nums + * @return PHP64 */ public static function min(PHP64 ...$nums) { @@ -324,7 +348,8 @@ class PHP64 extends PHP /** * Return the maximum BigInteger between an arbitrary number of BigIntegers. * - * @return \phpseclib\Math\BigInteger\Engines\PHP64 + * @param PHP64[] $nums + * @return PHP64 */ public static function max(PHP64 ...$nums) { @@ -334,7 +359,9 @@ class PHP64 extends PHP /** * Tests BigInteger to see if it is between two integers, inclusive * - * @return boolean + * @param PHP64 $min + * @param PHP64 $max + * @return bool */ public function between(PHP64 $min, PHP64 $max) { diff --git a/phpseclib/Net/SCP.php b/phpseclib/Net/SCP.php index 78d46a0f..3b011304 100644 --- a/phpseclib/Net/SCP.php +++ b/phpseclib/Net/SCP.php @@ -104,7 +104,6 @@ class SCP * Connects to an SSH server * * @param \phpseclib\Net\SSH1|\phpseclib\Net\SSH2 $ssh - * @return \phpseclib\Net\SCP * @access public */ public function __construct($ssh) @@ -212,7 +211,7 @@ class SCP * operation * * @param string $remote_file - * @param string $local_file + * @param string|boolean $local_file * @return mixed * @access public */ diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 5ee2287e..46cd764a 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1180,7 +1180,7 @@ class SFTP extends SSH2 * * Mainly used by file_exists * - * @param string $dir + * @param $path * @return mixed * @access private */ @@ -1733,6 +1733,8 @@ class SFTP extends SSH2 * Creates a directory. * * @param string $dir + * @param int $mode + * @param bool $recursive * @return bool * @access public */ @@ -1768,8 +1770,8 @@ class SFTP extends SSH2 * Helper function for directory creation * * @param string $dir + * @param $attr * @return bool - * @throws \UnexpectedValueException on receipt of unexpected packets * @access private */ private function mkdir_helper($dir, $attr) @@ -2115,7 +2117,7 @@ class SFTP extends SSH2 * $offset and $length can be used to download files in chunks. * * @param string $remote_file - * @param string $local_file + * @param string|boolean|resource $local_file * @param int $offset * @param int $length * @throws \UnexpectedValueException on receipt of unexpected packets @@ -2666,6 +2668,7 @@ class SFTP extends SSH2 * * @param string $path * @param string $prop + * @param $type * @return mixed * @access private */ diff --git a/phpseclib/Net/SFTP/Stream.php b/phpseclib/Net/SFTP/Stream.php index a0c3bd3a..8cf094db 100644 --- a/phpseclib/Net/SFTP/Stream.php +++ b/phpseclib/Net/SFTP/Stream.php @@ -626,7 +626,6 @@ class Stream * $options. What does 8 correspond to? * * @param string $path - * @param int $mode * @param int $options * @return bool * @access public diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 8cb3c625..e11741f3 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -234,7 +234,7 @@ class SSH1 /** * The Socket Object * - * @var object + * @var resource * @access private */ private $fsock; @@ -812,8 +812,8 @@ class SSH1 * @see self::interactiveRead() * @see self::interactiveWrite() * @param string $cmd + * @param bool $block * @return mixed - * @throws \RuntimeException on error sending command * @access public */ public function exec($cmd, $block = true) @@ -1558,7 +1558,8 @@ class SSH1 * * Makes sure that only the last 1MB worth of packets will be logged * - * @param string $data + * @param $protocol_flags + * @param $message * @access private */ private function append_log($protocol_flags, $message) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index e67fe0a9..98afca2b 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1292,8 +1292,8 @@ class SSH2 /** * Key Exchange - * - * @param string $kexinit_payload_server optional + * @return boolean + * @param string|boolean $kexinit_payload_server optional * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \RuntimeException on other errors * @throws \phpseclib\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible @@ -3220,8 +3220,8 @@ class SSH2 * See '6. Binary Packet Protocol' of rfc4253 for more info. * * @see self::_send_binary_packet() + * @param bool $filter_channel_packets * @return string - * @throws \RuntimeException on connection errors * @access private */ private function get_binary_packet($filter_channel_packets = false) @@ -3314,6 +3314,8 @@ class SSH2 * Because some binary packets need to be ignored... * * @see self::_get_binary_packet() + * @param $payload + * @param $filter_channel_packets * @return string * @access private */ @@ -3551,6 +3553,7 @@ class SSH2 * Returns the data as a string if it's available and false if not. * * @param $client_channel + * @param boolean $skip_extended * @return mixed * @throws \RuntimeException on connection error * @access private @@ -3871,7 +3874,8 @@ class SSH2 * * Makes sure that only the last 1MB worth of packets will be logged * - * @param string $data + * @param $message_number + * @param $message * @access private */ private function append_log($message_number, $message) diff --git a/phpseclib/System/SSH/Agent/Identity.php b/phpseclib/System/SSH/Agent/Identity.php index fd36fef3..198bc99e 100644 --- a/phpseclib/System/SSH/Agent/Identity.php +++ b/phpseclib/System/SSH/Agent/Identity.php @@ -107,7 +107,7 @@ class Identity * * Wrapper for $this->key->getPublicKey() * - * @param int $type optional + * @param string $type optional * @return mixed * @access public */