diff --git a/phpseclib/Crypt/DH.php b/phpseclib/Crypt/DH.php index 5186f032..2547614a 100644 --- a/phpseclib/Crypt/DH.php +++ b/phpseclib/Crypt/DH.php @@ -326,9 +326,8 @@ abstract class DH extends AsymmetricKey * OnLoad Handler * * @return bool - * @param array $components */ - protected static function onLoad($components) + protected static function onLoad(array $components) { if (!isset($components['privateKey']) && !isset($components['publicKey'])) { $new = new Parameters(); diff --git a/phpseclib/Crypt/DSA.php b/phpseclib/Crypt/DSA.php index 964a34cd..1d265860 100644 --- a/phpseclib/Crypt/DSA.php +++ b/phpseclib/Crypt/DSA.php @@ -214,9 +214,8 @@ abstract class DSA extends AsymmetricKey * OnLoad Handler * * @return bool - * @param array $components */ - protected static function onLoad($components) + protected static function onLoad(array $components) { if (!isset(self::$engines['PHP'])) { self::useBestEngine(); diff --git a/phpseclib/Crypt/EC.php b/phpseclib/Crypt/EC.php index 703a7bc0..a6dc40c7 100644 --- a/phpseclib/Crypt/EC.php +++ b/phpseclib/Crypt/EC.php @@ -199,9 +199,8 @@ abstract class EC extends AsymmetricKey * OnLoad Handler * * @return bool - * @param array $components */ - protected static function onLoad($components) + protected static function onLoad(array $components) { if (!isset(self::$engines['PHP'])) { self::useBestEngine(); diff --git a/phpseclib/Crypt/EC/BaseCurves/Prime.php b/phpseclib/Crypt/EC/BaseCurves/Prime.php index d6fb2bb5..6250dfb0 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Prime.php +++ b/phpseclib/Crypt/EC/BaseCurves/Prime.php @@ -645,7 +645,7 @@ class Prime extends Base * * @return int[] */ - private function getNAFPoints($point, $wnd) + private function getNAFPoints(array $point, $wnd) { if (isset($point['naf'])) { return $point['naf']; diff --git a/phpseclib/Crypt/EC/Formats/Keys/XML.php b/phpseclib/Crypt/EC/Formats/Keys/XML.php index d548bc27..f82c013f 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/XML.php +++ b/phpseclib/Crypt/EC/Formats/Keys/XML.php @@ -115,7 +115,7 @@ abstract class XML * @param bool $decode optional * @return \DOMNodeList */ - private static function query($xpath, $name, $error = null, $decode = true) + private static function query(\DOMXPath $xpath, $name, $error = null, $decode = true) { $query = '/'; $names = explode('/', $name); diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index e96ba359..6d2d47a4 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -422,9 +422,8 @@ abstract class RSA extends AsymmetricKey * OnLoad Handler * * @return bool - * @param array $components */ - protected static function onLoad($components) + protected static function onLoad(array $components) { $key = $components['isPublicKey'] ? new PublicKey() : diff --git a/phpseclib/Crypt/RSA/PrivateKey.php b/phpseclib/Crypt/RSA/PrivateKey.php index b5e197af..0d9c51ee 100644 --- a/phpseclib/Crypt/RSA/PrivateKey.php +++ b/phpseclib/Crypt/RSA/PrivateKey.php @@ -60,10 +60,9 @@ class PrivateKey extends RSA implements Common\PrivateKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. * - * @param \phpseclib3\Math\BigInteger $c * @return bool|\phpseclib3\Math\BigInteger */ - private function rsadp($c) + private function rsadp(BigInteger $c) { if ($c->compare(self::$zero) < 0 || $c->compare($this->modulus) > 0) { throw new \OutOfRangeException('Ciphertext representative out of range'); @@ -76,10 +75,9 @@ class PrivateKey extends RSA implements Common\PrivateKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. * - * @param \phpseclib3\Math\BigInteger $m * @return bool|\phpseclib3\Math\BigInteger */ - private function rsasp1($m) + private function rsasp1(BigInteger $m) { if ($m->compare(self::$zero) < 0 || $m->compare($this->modulus) > 0) { throw new \OutOfRangeException('Signature representative out of range'); @@ -176,7 +174,7 @@ class PrivateKey extends RSA implements Common\PrivateKey * @param int $i * @return \phpseclib3\Math\BigInteger */ - private function blind($x, $r, $i) + private function blind(BigInteger $x, BigInteger $r, $i) { $x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i])); $x = $x->modPow($this->exponents[$i], $this->primes[$i]); diff --git a/phpseclib/Crypt/RSA/PublicKey.php b/phpseclib/Crypt/RSA/PublicKey.php index 89408792..5e267b9e 100644 --- a/phpseclib/Crypt/RSA/PublicKey.php +++ b/phpseclib/Crypt/RSA/PublicKey.php @@ -364,7 +364,7 @@ class PublicKey extends RSA implements Common\PublicKey * @throws \LengthException if strlen($m) > $this->k - 2 * $this->hLen - 2 * @return string */ - private function rsaes_oaep_encrypt($m) + private function rsaes_oaep_encrypt(BigInteger $m) { $mLen = strlen($m); diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 4f940b76..5803a372 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -440,7 +440,7 @@ class ANSI * @param string $char * @return string */ - private function processCoordinate($last_attr, $cur_attr, $char) + private function processCoordinate(\stdClass $last_attr, \stdClass $cur_attr, $char) { $output = ''; diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 8915ad0b..39a0dc0d 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -516,12 +516,8 @@ abstract class ASN1 * @param array $special * @return array|bool|Element|string|null */ - public static function asn1map($decoded, $mapping, $special = []) + public static function asn1map(array $decoded, $mapping, $special = []) { - if (!is_array($decoded)) { - return false; - } - if (isset($mapping['explicit']) && is_array($decoded['content'])) { $decoded = $decoded['content'][0]; } @@ -854,7 +850,7 @@ abstract class ASN1 * @param array $special * @return string */ - private static function encode_der($source, $mapping, $idx = null, $special = []) + private static function encode_der($source, array $mapping, $idx = null, array $special = []) { if ($source instanceof Element) { return $source->element; @@ -1310,7 +1306,7 @@ abstract class ASN1 * * @param array $oids */ - public static function loadOIDs($oids) + public static function loadOIDs(array $oids) { self::$reverseOIDs += $oids; self::$oids = array_flip(self::$reverseOIDs); @@ -1324,7 +1320,7 @@ abstract class ASN1 * * @param array $filters */ - public static function setFilters($filters) + public static function setFilters(array $filters) { self::$filters = $filters; } diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 379863b4..88aedf08 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -507,7 +507,7 @@ class X509 * @param int $format optional * @return string */ - public function saveX509($cert, $format = self::FORMAT_PEM) + public function saveX509(array $cert, $format = self::FORMAT_PEM) { if (!is_array($cert) || !isset($cert['tbsCertificate'])) { return false; @@ -577,7 +577,7 @@ class X509 * @param array $root (by reference) * @param string $path */ - private function mapInExtensions(&$root, $path) + private function mapInExtensions(array &$root, $path) { $extensions = &$this->subArrayUnchecked($root, $path); @@ -625,7 +625,7 @@ class X509 * @param array $root (by reference) * @param string $path */ - private function mapOutExtensions(&$root, $path) + private function mapOutExtensions(array &$root, $path) { $extensions = &$this->subArray($root, $path, !empty($this->extensionValues)); @@ -786,7 +786,7 @@ class X509 * @param array $root (by reference) * @param string $path */ - private function mapInDNs(&$root, $path) + private function mapInDNs(array &$root, $path) { $dns = &$this->subArray($root, $path); @@ -814,7 +814,7 @@ class X509 * @param array $root (by reference) * @param string $path */ - private function mapOutDNs(&$root, $path) + private function mapOutDNs(array &$root, $path) { $dns = &$this->subArray($root, $path);