Psalm coverage for phpseclib3\Math\

This commit is contained in:
Jack Worman 2022-02-21 18:56:19 -06:00 committed by terrafrost
parent b6f93a4a21
commit 6bad45c016
8 changed files with 32 additions and 31 deletions

View File

@ -793,7 +793,7 @@ class BigInteger
/** /**
* Is Odd? * Is Odd?
* *
* @return boolean * @return bool
*/ */
public function isOdd() public function isOdd()
{ {
@ -804,7 +804,7 @@ class BigInteger
* Tests if a bit is set * Tests if a bit is set
* *
* @param int $x * @param int $x
* @return boolean * @return bool
*/ */
public function testBit($x) public function testBit($x)
{ {
@ -814,7 +814,7 @@ class BigInteger
/** /**
* Is Negative? * Is Negative?
* *
* @return boolean * @return bool
*/ */
public function isNegative() public function isNegative()
{ {
@ -869,7 +869,7 @@ class BigInteger
* Splits BigInteger's into chunks of $split bits * Splits BigInteger's into chunks of $split bits
* *
* @param int $split * @param int $split
* @return \phpseclib3\Math\BigInteger[] * @return BigInteger[]
*/ */
public function bitwise_split($split) public function bitwise_split($split)
{ {

View File

@ -237,7 +237,7 @@ class BCMath extends Engine
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
* *
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $n * @param BCMath $n
* @return false|BCMath * @return false|BCMath
*/ */
public function modInverse(BCMath $n) public function modInverse(BCMath $n)
@ -311,7 +311,7 @@ class BCMath extends Engine
/** /**
* Absolute value. * Absolute value.
* *
* @return \phpseclib3\Math\BigInteger\Engines\BCMath * @return BCMath
*/ */
public function abs() public function abs()
{ {
@ -362,7 +362,7 @@ class BCMath extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\BCMath * @return BCMath
*/ */
public function bitwise_rightShift($shift) public function bitwise_rightShift($shift)
{ {
@ -378,7 +378,7 @@ class BCMath extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\BCMath * @return BCMath
*/ */
public function bitwise_leftShift($shift) public function bitwise_leftShift($shift)
{ {
@ -672,7 +672,7 @@ class BCMath extends Engine
/** /**
* Is Negative? * Is Negative?
* *
* @return boolean * @return bool
*/ */
public function isNegative() public function isNegative()
{ {

View File

@ -54,11 +54,11 @@ abstract class Base extends BCMath
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $x * @param BCMath $x
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $e * @param BCMath $e
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $n * @param BCMath $n
* @param string $class * @param string $class
* @return \phpseclib3\Math\BigInteger\Engines\BCMath * @return BCMath
*/ */
protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n, $class) protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n, $class)
{ {

View File

@ -61,7 +61,7 @@ abstract class Barrett extends Base
* *
* @param string $n * @param string $n
* @param string $m * @param string $m
* @return array|string * @return string
*/ */
protected static function reduce($n, $m) protected static function reduce($n, $m)
{ {

View File

@ -298,8 +298,8 @@ class GMP extends Engine
* combination is returned is dependent upon which mode is in use. See * 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. * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
* *
* @param \phpseclib3\Math\BigInteger\Engines\GMP $n * @param GMP $n
* @return \phpseclib3\Math\BigInteger\Engines\GMP[] * @return GMP[]
*/ */
public function extendedGCD(GMP $n) public function extendedGCD(GMP $n)
{ {
@ -329,7 +329,7 @@ class GMP extends Engine
/** /**
* Absolute value. * Absolute value.
* *
* @return \phpseclib3\Math\BigInteger\Engines\GMP * @return GMP
* @access public * @access public
*/ */
public function abs() public function abs()
@ -388,7 +388,7 @@ class GMP extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\GMP * @return GMP
*/ */
public function bitwise_rightShift($shift) public function bitwise_rightShift($shift)
{ {
@ -407,7 +407,7 @@ class GMP extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\GMP * @return GMP
*/ */
public function bitwise_leftShift($shift) public function bitwise_leftShift($shift)
{ {
@ -658,7 +658,7 @@ class GMP extends Engine
/** /**
* Is Odd? * Is Odd?
* *
* @return boolean * @return bool
*/ */
public function isOdd() public function isOdd()
{ {
@ -668,7 +668,7 @@ class GMP extends Engine
/** /**
* Tests if a bit is set * Tests if a bit is set
* *
* @return boolean * @return bool
*/ */
public function testBit($x) public function testBit($x)
{ {
@ -678,7 +678,7 @@ class GMP extends Engine
/** /**
* Is Negative? * Is Negative?
* *
* @return boolean * @return bool
*/ */
public function isNegative() public function isNegative()
{ {

View File

@ -76,7 +76,7 @@ abstract class PHP extends Engine
* *
* @param mixed $x integer Base-10 number or base-$base number if $base set. * @param mixed $x integer Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @return \phpseclib3\Math\BigInteger\Engines\PHP * @return PHP
* @see parent::__construct() * @see parent::__construct()
*/ */
public function __construct($x = 0, $base = 10) public function __construct($x = 0, $base = 10)
@ -814,7 +814,7 @@ abstract class PHP extends Engine
/** /**
* Absolute value. * Absolute value.
* *
* @return \phpseclib3\Math\BigInteger\Engines\PHP * @return PHP
*/ */
public function abs() public function abs()
{ {
@ -850,7 +850,7 @@ abstract class PHP extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\PHP * @return PHP
*/ */
public function bitwise_rightShift($shift) public function bitwise_rightShift($shift)
{ {
@ -870,7 +870,7 @@ abstract class PHP extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
* *
* @param int $shift * @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\PHP * @return PHP
*/ */
public function bitwise_leftShift($shift) public function bitwise_leftShift($shift)
{ {

View File

@ -74,11 +74,11 @@ abstract class Base extends PHP
* the other, a power of two - and recombine them, later. This is the method that this modPow function uses. * the other, a power of two - and recombine them, later. This is the method that this modPow function uses.
* {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates. * {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates.
* *
* @param \phpseclib3\Math\BigInteger\Engines\PHP $x * @param PHP $x
* @param \phpseclib3\Math\BigInteger\Engines\PHP $e * @param PHP $e
* @param \phpseclib3\Math\BigInteger\Engines\PHP $n * @param PHP $n
* @param string $class * @param string $class
* @return \phpseclib3\Math\BigInteger\Engines\PHP * @return PHP
*/ */
protected static function powModHelper(PHP $x, PHP $e, PHP $n, $class) protected static function powModHelper(PHP $x, PHP $e, PHP $n, $class)
{ {

View File

@ -15,6 +15,7 @@
namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions;
use phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Base; use phpseclib3\Math\BigInteger\Engines\PHP\Base;
/** /**
@ -46,7 +47,7 @@ abstract class Barrett extends Base
* *
* @param array $n * @param array $n
* @param array $m * @param array $m
* @param string $class * @param class-string<PHP> $class
* @return array * @return array
*/ */
protected static function reduce(array $n, array $m, $class) protected static function reduce(array $n, array $m, $class)