Skip to content

Commit

Permalink
Updating gmp docblocks, removing ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydiablo committed Apr 26, 2018
1 parent 0cf4a8b commit 7ed3c16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ parameters:
- '#Class Zend_Crypt_Rsa_Key_Public constructor invoked with 2 parameters, 1 required\.#'
# This should probably be changed to a do/while loop instead of just while, Zend_Crypt_Math_BigInteger_Bcmath:215
- '#Variable \$hex might not be defined\.#'
# Possibly issues with stubs, haven't researched
- '#Parameter \#1 \$gmpnumber of function gmp_strval expects resource\|string, GMP given\.#'
- '#Parameter \#1 \$gmpnumber of function gmp_strval expects resource\|string, int given\.#'
- '#Parameter \#1 \$a of function gmp_sqrt expects resource\|string, object\|resource\|string given\.#'
- '#Parameter \#2 \$b of function gmp_mul expects resource\|string, int given\.#'
# These methods exist on Zend_Crypt_Math but $_math property is typehinted as Zend_Crypt_Math_BigInteger_Interface
- '#Call to an undefined method Zend_Crypt_Math_BigInteger::fromBinary\(\)\.#'
- '#Call to an undefined method Zend_Crypt_Math_BigInteger::toBinary\(\)\.#'
Expand Down
36 changes: 18 additions & 18 deletions src/Zend/Crypt/Math/BigInteger/Gmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function init($operand, $base = 10)
/**
* Adds two arbitrary precision numbers
*
* @param resource $left_operand
* @param resource $right_operand
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @return string
*/
public function add($left_operand, $right_operand)
Expand All @@ -61,8 +61,8 @@ public function add($left_operand, $right_operand)
/**
* Subtract numbers
*
* @param resource $left_operand
* @param resource $right_operand
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @return string
*/
public function subtract($left_operand, $right_operand)
Expand All @@ -76,8 +76,8 @@ public function subtract($left_operand, $right_operand)
* both are identical, 1 that left_operand is larger, or -1 that
* right_operand is larger.
*
* @param resource $left_operand
* @param resource $right_operand
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @return string
*/
public function compare($left_operand, $right_operand)
Expand All @@ -90,8 +90,8 @@ public function compare($left_operand, $right_operand)
* Divide two big integers and return result or NULL if the denominator
* is zero.
*
* @param resource $left_operand
* @param resource $right_operand
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @return string|null
*/
public function divide($left_operand, $right_operand)
Expand All @@ -103,8 +103,8 @@ public function divide($left_operand, $right_operand)
/**
* Modulo operation
*
* @param resource $left_operand
* @param resource $modulus
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $modulus
* @internal param string $right_operand
* @return string
*/
Expand All @@ -117,8 +117,8 @@ public function modulus($left_operand, $modulus)
/**
* Multiply numbers
*
* @param resource $left_operand
* @param resource $right_operand
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @return string
*/
public function multiply($left_operand, $right_operand)
Expand All @@ -130,7 +130,7 @@ public function multiply($left_operand, $right_operand)
/**
* Raise number into power
*
* @param resource $left_operand
* @param string|GMP|resource $left_operand
* @param int $right_operand
* @return string
*/
Expand All @@ -143,9 +143,9 @@ public function pow($left_operand, $right_operand)
/**
* Raise number into power with modulo
*
* @param resource $left_operand
* @param resource $right_operand
* @param resource $modulus
* @param string|GMP|resource $left_operand
* @param string|GMP|resource $right_operand
* @param string|GMP|resource $modulus
* @return string
*/
public function powmod($left_operand, $right_operand, $modulus)
Expand All @@ -157,7 +157,7 @@ public function powmod($left_operand, $right_operand, $modulus)
/**
* Calculate square root
*
* @param string|object|resource $operand
* @param string|GMP|resource $operand
* @return string
*/
public function sqrt($operand)
Expand All @@ -182,7 +182,7 @@ public function binaryToInteger($operand)
}

/**
* @param resource $operand GMP number resource
* @param string|GMP|resource $operand GMP number resource
* @return string
*/
public function integerToBinary($operand)
Expand Down

0 comments on commit 7ed3c16

Please sign in to comment.