Skip to content

Commit

Permalink
Fix phpdoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Sep 9, 2020
1 parent 2e9d5a9 commit 2ae6834
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 59 deletions.
2 changes: 1 addition & 1 deletion phpseclib/Crypt/Base.php
Expand Up @@ -2584,7 +2584,7 @@ function &_getLambdaFunctions()
*
* @see self::_setupInlineCrypt()
* @access private
* @param $bytes
* @param string $bytes
* @return string
*/
function _hashInlineCryptFunction($bytes)
Expand Down
3 changes: 1 addition & 2 deletions phpseclib/Crypt/Hash.php
Expand Up @@ -191,7 +191,7 @@ function __construct($hash = 'sha1')
* PHP4 compatible Default Constructor.
*
* @see self::__construct()
* @param int $mode
* @param string $hash
* @access public
*/
function Crypt_Hash($hash = 'sha1')
Expand Down Expand Up @@ -879,7 +879,6 @@ function _not($int)
* _sha256() adds multiple unsigned 32-bit integers. Since PHP doesn't support unsigned integers and since the
* possibility of overflow exists, care has to be taken. Math_BigInteger() could be used but this should be faster.
*
* @param int $...
* @return int
* @see self::_sha256()
* @access private
Expand Down
28 changes: 16 additions & 12 deletions phpseclib/Crypt/RSA.php
Expand Up @@ -589,7 +589,7 @@ function Crypt_RSA()
* @access public
* @param int $bits
* @param int $timeout
* @param Math_BigInteger $p
* @param array $partial
*/
function createKey($bits = 1024, $timeout = false, $partial = array())
{
Expand Down Expand Up @@ -768,7 +768,12 @@ function createKey($bits = 1024, $timeout = false, $partial = array())
*
* @access private
* @see self::setPrivateKeyFormat()
* @param string $RSAPrivateKey
* @param Math_BigInteger $n
* @param Math_BigInteger $e
* @param Math_BigInteger $d
* @param array<int,Math_BigInteger> $primes
* @param array<int,Math_BigInteger> $exponents
* @param array<int,Math_BigInteger> $coefficients
* @return string
*/
function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
Expand Down Expand Up @@ -1061,8 +1066,9 @@ function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
*
* @access private
* @see self::setPublicKeyFormat()
* @param string $RSAPrivateKey
* @return string
* @param Math_BigInteger $n
* @param Math_BigInteger $e
* @return string|array<string,Math_BigInteger>
*/
function _convertPublicKey($n, $e)
{
Expand Down Expand Up @@ -1964,7 +1970,6 @@ function setPrivateKey($key = false, $type = false)
*
* @see self::getPublicKey()
* @access public
* @param string $key
* @param int $type optional
*/
function getPublicKey($type = CRYPT_RSA_PUBLIC_FORMAT_PKCS8)
Expand Down Expand Up @@ -2022,7 +2027,6 @@ function getPublicKeyFingerprint($algorithm = 'md5')
*
* @see self::getPublicKey()
* @access public
* @param string $key
* @param int $type optional
* @return mixed
*/
Expand All @@ -2047,8 +2051,7 @@ function getPrivateKey($type = CRYPT_RSA_PUBLIC_FORMAT_PKCS1)
*
* @see self::getPrivateKey()
* @access private
* @param string $key
* @param int $type optional
* @param int $mode optional
*/
function _getPrivatePublicKey($mode = CRYPT_RSA_PUBLIC_FORMAT_PKCS8)
{
Expand Down Expand Up @@ -2265,7 +2268,7 @@ function setMGFHash($hash)
* of the hash function Hash) and 0.
*
* @access public
* @param int $format
* @param int $sLen
*/
function setSaltLength($sLen)
{
Expand Down Expand Up @@ -2298,7 +2301,7 @@ function _i2osp($x, $xLen)
* See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
*
* @access private
* @param string $x
* @param int|string|resource $x
* @return Math_BigInteger
*/
function _os2ip($x)
Expand Down Expand Up @@ -2525,7 +2528,7 @@ function _rsavp1($s)
*
* @access private
* @param string $mgfSeed
* @param int $mgfLen
* @param int $maskLen
* @return string
*/
function _mgf1($mgfSeed, $maskLen)
Expand Down Expand Up @@ -3034,6 +3037,7 @@ function _rsassa_pkcs1_v1_5_sign($m)
*
* @access private
* @param string $m
* @param string $s
* @return string
*/
function _rsassa_pkcs1_v1_5_verify($m, $s)
Expand Down Expand Up @@ -3174,7 +3178,7 @@ function encrypt($plaintext)
*
* @see self::encrypt()
* @access public
* @param string $plaintext
* @param string $ciphertext
* @return string
*/
function decrypt($ciphertext)
Expand Down
3 changes: 1 addition & 2 deletions phpseclib/File/ANSI.php
Expand Up @@ -230,8 +230,7 @@ function setDimensions($x, $y)
/**
* Set the number of lines that should be logged past the terminal height
*
* @param int $x
* @param int $y
* @param int $history
* @access public
*/
function setHistory($history)
Expand Down
7 changes: 4 additions & 3 deletions phpseclib/File/ASN1.php
Expand Up @@ -140,7 +140,7 @@ function __construct($encoded)
* PHP4 compatible Default Constructor.
*
* @see self::__construct()
* @param int $mode
* @param string $encoded
* @access public
*/
function File_ASN1_Element($encoded)
Expand Down Expand Up @@ -887,7 +887,7 @@ function asn1map($decoded, $mapping, $special = array())
*
* @param string $source
* @param string $mapping
* @param int $idx
* @param array $special
* @return string
* @access public
*/
Expand All @@ -903,6 +903,7 @@ function encodeDER($source, $mapping, $special = array())
* @param string $source
* @param string $mapping
* @param int $idx
* @param array $special
* @return string
* @access private
*/
Expand Down Expand Up @@ -1262,7 +1263,7 @@ function _decodeOID($content)
* Called by _encode_der()
*
* @access private
* @param string $content
* @param string $source
* @return string
*/
function _encodeOID($source)
Expand Down
24 changes: 12 additions & 12 deletions phpseclib/File/X509.php
Expand Up @@ -1638,7 +1638,7 @@ function saveX509($cert, $format = FILE_X509_FORMAT_PEM)
* Map extension values from octet string to extension-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -1691,7 +1691,7 @@ function _mapInExtensions(&$root, $path, $asn1)
* Map extension values from extension-specific internal format to
* octet string.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -1757,7 +1757,7 @@ function _mapOutExtensions(&$root, $path, $asn1)
* Map attribute values from ANY type to attribute-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -1798,7 +1798,7 @@ function _mapInAttributes(&$root, $path, $asn1)
* Map attribute values from attribute-specific internal format to
* ANY type.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -1841,7 +1841,7 @@ function _mapOutAttributes(&$root, $path, $asn1)
* Map DN values from ANY type to DN-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -1871,7 +1871,7 @@ function _mapInDNs(&$root, $path, $asn1)
* Map DN values from DN-specific internal format to
* ANY type.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
Expand Down Expand Up @@ -3243,7 +3243,8 @@ function getPublicKey()
/**
* Load a Certificate Signing Request
*
* @param string $csr
* @param string|array $csr
* @param int $mode
* @access public
* @return mixed
*/
Expand Down Expand Up @@ -3383,7 +3384,7 @@ function saveCSR($csr, $format = FILE_X509_FORMAT_PEM)
*
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
*
* @param string $csr
* @param string|array $spkac
* @access public
* @return mixed
*/
Expand Down Expand Up @@ -3457,7 +3458,7 @@ function loadSPKAC($spkac)
/**
* Save a SPKAC CSR request
*
* @param array $csr
* @param string|array $spkac
* @param int $format optional
* @access public
* @return string
Expand Down Expand Up @@ -3501,6 +3502,7 @@ function saveSPKAC($spkac, $format = FILE_X509_FORMAT_PEM)
* Load a Certificate Revocation List
*
* @param string $crl
* @param int $mode
* @access public
* @return mixed
*/
Expand Down Expand Up @@ -4114,7 +4116,6 @@ function signCRL($issuer, $crl, $signatureAlgorithm = 'sha1WithRSAEncryption')
* X.509 certificate signing helper function.
*
* @param object $key
* @param File_X509 $subject
* @param string $signatureAlgorithm
* @access public
* @return mixed
Expand Down Expand Up @@ -4192,7 +4193,7 @@ function setEndDate($date)
* Set Serial Number
*
* @param string $serial
* @param $base optional
* @param int $base optional
* @access public
*/
function setSerialNumber($serial, $base = -256)
Expand Down Expand Up @@ -4866,7 +4867,6 @@ function setDomain()
* Set the IP Addresses's which the cert is to be valid for
*
* @access public
* @param string $ipAddress optional
*/
function setIPAddress()
{
Expand Down
20 changes: 10 additions & 10 deletions phpseclib/Math/BigInteger.php
Expand Up @@ -237,7 +237,7 @@ class Math_BigInteger
* ?>
* </code>
*
* @param $x base-10 number or base-$base number if $base set.
* @param int|string|resource $x base-10 number or base-$base number if $base set.
* @param int $base
* @return Math_BigInteger
* @access public
Expand Down Expand Up @@ -2021,7 +2021,7 @@ function _squareReduce($x, $n, $mode)
*
* @see self::_slidingWindow()
* @access private
* @param Math_BigInteger
* @param Math_BigInteger $n
* @return Math_BigInteger
*/
function _mod2($n)
Expand Down Expand Up @@ -3136,7 +3136,7 @@ function setRandomGenerator($generator)
*
* Byte length is equal to $length. Uses crypt_random if it's loaded and mt_rand if it's not.
*
* @param int $length
* @param int $size
* @return Math_BigInteger
* @access private
*/
Expand Down Expand Up @@ -3603,7 +3603,7 @@ function _rshift($shift)
*
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
*
* @param Math_BigInteger
* @param Math_BigInteger $result
* @return Math_BigInteger
* @see self::_trim()
* @access private
Expand Down Expand Up @@ -3680,8 +3680,8 @@ function _trim($value)
/**
* Array Repeat
*
* @param $input Array
* @param $multiplier mixed
* @param array $input
* @param mixed $multiplier
* @return array
* @access private
*/
Expand All @@ -3695,8 +3695,8 @@ function _array_repeat($input, $multiplier)
*
* Shifts binary strings $shift bits, essentially multiplying by 2**$shift.
*
* @param $x String
* @param $shift Integer
* @param string $x (by reference)
* @param int $shift
* @return string
* @access private
*/
Expand Down Expand Up @@ -3724,8 +3724,8 @@ function _base256_lshift(&$x, $shift)
*
* Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder.
*
* @param $x String
* @param $shift Integer
* @param string $x (by referenc)
* @param int $shift
* @return string
* @access private
*/
Expand Down

0 comments on commit 2ae6834

Please sign in to comment.