More PHPDOC fixes

This commit is contained in:
Sokolovskyy Roman 2017-08-04 12:06:25 +02:00
parent eb21fb2bcb
commit 55cacdf7cd
14 changed files with 43 additions and 32 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
/vendor /vendor
/composer.phar /composer.phar
/.idea/
.gitignore

View File

@ -572,7 +572,7 @@ class X509
* Map extension values from octet string to extension-specific internal * Map extension values from octet string to extension-specific internal
* format. * format.
* *
* @param array ref $root * @param &array $root
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -618,7 +618,7 @@ class X509
* Map extension values from extension-specific internal format to * Map extension values from extension-specific internal format to
* octet string. * octet string.
* *
* @param array ref $root * @param &array Ref $root
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -682,7 +682,7 @@ class X509
* Map attribute values from ANY type to attribute-specific internal * Map attribute values from ANY type to attribute-specific internal
* format. * format.
* *
* @param array ref $root * @param &array Ref $root
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -722,7 +722,7 @@ class X509
* Map attribute values from attribute-specific internal format to * Map attribute values from attribute-specific internal format to
* ANY type. * ANY type.
* *
* @param array ref $root * @param &array $root Ref
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -764,7 +764,7 @@ class X509
* Map DN values from ANY type to DN-specific internal * Map DN values from ANY type to DN-specific internal
* format. * format.
* *
* @param array ref $root * @param &array $root
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -793,7 +793,7 @@ class X509
* Map DN values from DN-specific internal format to * Map DN values from DN-specific internal format to
* ANY type. * ANY type.
* *
* @param array ref $root * @param &array $root
* @param string $path * @param string $path
* @access private * @access private
*/ */
@ -1053,6 +1053,7 @@ class X509
* *
* @param int $date optional * @param int $date optional
* @access public * @access public
* @return boolean
*/ */
public function validateDate($date = null) public function validateDate($date = null)
{ {
@ -2051,7 +2052,7 @@ class X509
* *
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen * https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
* *
* @param string $csr * @param string $spkac
* @access public * @access public
* @return mixed * @return mixed
*/ */
@ -2119,7 +2120,7 @@ class X509
/** /**
* Save a SPKAC CSR request * Save a SPKAC CSR request
* *
* @param array $csr * @param array $spkac
* @param int $format optional * @param int $format optional
* @access public * @access public
* @return string * @return string
@ -2808,7 +2809,7 @@ class X509
* Set Serial Number * Set Serial Number
* *
* @param string $serial * @param string $serial
* @param $base optional * @param $base integer Optional
* @access public * @access public
*/ */
public function setSerialNumber($serial, $base = -256) public function setSerialNumber($serial, $base = -256)

View File

@ -120,7 +120,7 @@ class BigInteger implements \Serializable
* If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using * If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using
* two's compliment. The sole exception to this is -10, which is treated the same as 10 is. * two's compliment. The sole exception to this is -10, which is treated the same as 10 is.
* *
* @param $x base-10 number or base-$base number if $base set. * @param $x integer|BigInteger\Engines\Engine Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @return \phpseclib\Math\BigInteger * @return \phpseclib\Math\BigInteger
*/ */

View File

@ -100,7 +100,7 @@ class BCMath extends Engine
/** /**
* Default constructor * Default constructor
* *
* @param $x base-10 number or base-$base number if $base set. * @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @see parent::__construct() * @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @return \phpseclib\Math\BigInteger\Engines\BCMath
@ -549,7 +549,7 @@ class BCMath extends Engine
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * BigInteger::randomRange($max, $min)
* *
* @return \phpseclib\Math\BigInteger\Engines\Engine\BCMath * @return \phpseclib\Math\BigInteger\Engines\BCMath
*/ */
public static function randomRange(BCMath $min, BCMath $max) public static function randomRange(BCMath $min, BCMath $max)
{ {

View File

@ -59,7 +59,7 @@ abstract class Engine implements \Serializable
/** /**
* Default constructor * Default constructor
* *
* @param $x base-10 number or base-$base number if $base set. * @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @return \phpseclib\Math\BigInteger\Engines\Engine * @return \phpseclib\Math\BigInteger\Engines\Engine
*/ */

View File

@ -102,7 +102,7 @@ class GMP extends Engine
/** /**
* Default constructor * Default constructor
* *
* @param $x base-10 number or base-$base number if $base set. * @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @see parent::__construct() * @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\GMP * @return \phpseclib\Math\BigInteger\Engines\GMP
@ -511,7 +511,7 @@ class GMP extends Engine
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * BigInteger::randomRange($max, $min)
* *
* @return \phpseclib\Math\BigInteger\Engines\Engine\GMP * @return \phpseclib\Math\BigInteger\Engines\GMP
*/ */
public static function randomRange(GMP $min, GMP $max) public static function randomRange(GMP $min, GMP $max)
{ {

View File

@ -74,7 +74,7 @@ abstract class PHP extends Engine
/** /**
* Default constructor * Default constructor
* *
* @param $x base-10 number or base-$base number if $base set. * @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base * @param int $base
* @see parent::__construct() * @see parent::__construct()
* @return \phpseclib\Math\BigInteger\Engines\PHP * @return \phpseclib\Math\BigInteger\Engines\PHP
@ -524,7 +524,7 @@ abstract class PHP extends Engine
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * 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). * and the divisor (basically, the "common residue" is the first positive modulo).
* *
* @param \phpseclib\Math\BigInteger\PHP $y * @param \phpseclib\Math\BigInteger\engines\PHP $y
* @return array * @return array
* @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}. * @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}.
*/ */

View File

@ -42,11 +42,11 @@ abstract class Montgomery extends Base
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @param \phpseclib\Math\BigInteger\Engine $x * @param \phpseclib\Math\BigInteger\Engines\Engine $x
* @param \phpseclib\Math\BigInteger\Engine $e * @param \phpseclib\Math\BigInteger\Engines\Engine $e
* @param \phpseclib\Math\BigInteger\Engine $n * @param \phpseclib\Math\BigInteger\Engines\Engine $n
* @param string $class * @param string $class
* @return \phpseclib\Math\BigInteger\Engine|Engine * @return \phpseclib\Math\BigInteger\Engines\Engine
*/ */
protected static function slidingWindow(Engine $x, Engine $e, Engine $n, $class) protected static function slidingWindow(Engine $x, Engine $e, Engine $n, $class)
{ {

View File

@ -294,7 +294,7 @@ class PHP32 extends PHP
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * BigInteger::randomRange($max, $min)
* *
* @return \phpseclib\Math\BigInteger\Engines\Engine\PHP32 * @return \phpseclib\Math\BigInteger\Engines\PHP32
*/ */
public static function randomRange(PHP32 $min, PHP32 $max) public static function randomRange(PHP32 $min, PHP32 $max)
{ {

View File

@ -294,7 +294,7 @@ class PHP64 extends PHP
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * BigInteger::randomRange($max, $min)
* *
* @return \phpseclib\Math\BigInteger\Engines\Engine\PHP64 * @return \phpseclib\Math\BigInteger\Engines\PHP64
*/ */
public static function randomRange(PHP64 $min, PHP64 $max) public static function randomRange(PHP64 $min, PHP64 $max)
{ {

View File

@ -3084,7 +3084,7 @@ class SFTP extends SSH2
* *
* @param int $reason * @param int $reason
* @return bool * @return bool
* @access private * @access protected
*/ */
protected function disconnect_helper($reason) protected function disconnect_helper($reason)
{ {

View File

@ -868,7 +868,7 @@ class SSH2
/** /**
* A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario * A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario
* *
* @var System_SSH_Agent * @var \phpseclib\System\Ssh\Agent
* @access private * @access private
*/ */
private $agent; private $agent;
@ -3827,7 +3827,7 @@ class SSH2
* *
* @param int $reason * @param int $reason
* @return bool * @return bool
* @access private * @access protected
*/ */
protected function disconnect_helper($reason) protected function disconnect_helper($reason)
{ {
@ -3848,7 +3848,7 @@ class SSH2
* If any of the constants that would be defined already exists, none of the constants will be defined. * If any of the constants that would be defined already exists, none of the constants will be defined.
* *
* @param array $array * @param array $array
* @access private * @access protected
*/ */
protected function define_array() protected function define_array()
{ {

View File

@ -219,7 +219,7 @@ class Agent
* Signal that agent forwarding should * Signal that agent forwarding should
* be requested when a channel is opened * be requested when a channel is opened
* *
* @param Net_SSH2 $ssh * @param \phpseclib\Net\SSH2 $ssh
* @return bool * @return bool
* @access public * @access public
*/ */
@ -233,7 +233,7 @@ class Agent
/** /**
* Request agent forwarding of remote server * Request agent forwarding of remote server
* *
* @param Net_SSH2 $ssh * @param \phpseclib\Net\SSH2 $ssh
* @return bool * @return bool
* @access private * @access private
*/ */
@ -276,7 +276,7 @@ class Agent
* open to give the SSH Agent an opportunity * open to give the SSH Agent an opportunity
* to take further action. i.e. request agent forwarding * to take further action. i.e. request agent forwarding
* *
* @param Net_SSH2 $ssh * @param \phpseclib\Net\SSH2 $ssh
* @access private * @access private
*/ */
private function on_channel_open($ssh) private function on_channel_open($ssh)
@ -290,7 +290,7 @@ class Agent
* Forward data to SSH Agent and return data reply * Forward data to SSH Agent and return data reply
* *
* @param string $data * @param string $data
* @return data from SSH Agent * @return string Data from SSH Agent
* @throws \RuntimeException on connection errors * @throws \RuntimeException on connection errors
* @access private * @access private
*/ */

View File

@ -77,7 +77,15 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
$bf = new Blowfish('cbc'); $bf = new Blowfish('cbc');
$bf->setKey($key); $bf->setKey($key);
$bf->setIV(str_repeat("\0", $bf->getBlockLength() >> 3)); $bf->setIV(str_repeat("\0", $bf->getBlockLength() >> 3));
if (!$bf->isValidEngine($engine)) {
$engines = array(
'PHP'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_INTERNAL,
'Eval'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_EVAL,
'mcrypt'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_MCRYPT,
'OpenSSL'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_OPENSSL,
);
if (!$bf->isValidEngine($engines[$engine])) {
self::markTestSkipped("Unable to initialize $engine engine"); self::markTestSkipped("Unable to initialize $engine engine");
} }
$bf->setPreferredEngine($engine); $bf->setPreferredEngine($engine);