From 10075ea57e8afbbebef3a6a0f85d84f783fc36a4 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 3 Aug 2024 09:47:18 -0500 Subject: [PATCH 1/2] SSH/Agent: make it so identities include key comments and add new findIdentityByPublicKey() method --- phpseclib/System/SSH/Agent.php | 22 +++++++++++++++++- phpseclib/System/SSH/Agent/Identity.php | 30 +++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index 26ca3227..7897c8f7 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -33,6 +33,7 @@ namespace phpseclib3\System\SSH; use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\PublicKey; use phpseclib3\Crypt\PublicKeyLoader; use phpseclib3\Crypt\RSA; use phpseclib3\Exception\BadConfigurationException; @@ -192,7 +193,8 @@ class Agent if (isset($key)) { $identity = (new Identity($this->fsock)) ->withPublicKey($key) - ->withPublicKeyBlob($key_blob); + ->withPublicKeyBlob($key_blob) + ->withComment($comment); $identities[] = $identity; unset($key); } @@ -201,6 +203,24 @@ class Agent return $identities; } + /** + * Returns the SSH Agent identity matching a given public key or null if no identity is found + * + * @return ?Identity + */ + public function findIdentityByPublicKey(PublicKey $key) + { + $identities = $this->requestIdentities(); + $key = (string) $key; + foreach ($identities as $identity) { + if (((string) $identity->getPublicKey()) == $key) { + return $identity; + } + } + + return null; + } + /** * Signal that agent forwarding should * be requested when a channel is opened diff --git a/phpseclib/System/SSH/Agent/Identity.php b/phpseclib/System/SSH/Agent/Identity.php index 653e8ea5..ed4214f3 100644 --- a/phpseclib/System/SSH/Agent/Identity.php +++ b/phpseclib/System/SSH/Agent/Identity.php @@ -79,6 +79,13 @@ class Identity implements PrivateKey */ private $flags = 0; + /** + * Comment + * + * @var null|string + */ + private $comment; + /** * Curve Aliases * @@ -141,10 +148,9 @@ class Identity implements PrivateKey * * Wrapper for $this->key->getPublicKey() * - * @param string $type optional * @return mixed */ - public function getPublicKey($type = 'PKCS8') + public function getPublicKey() { return $this->key; } @@ -317,4 +323,24 @@ class Identity implements PrivateKey { throw new \RuntimeException('ssh-agent does not provide a mechanism to get the private key'); } + + /** + * Sets the comment + */ + public function withComment($comment = null) + { + $new = clone $this; + $new->comment = $comment; + return $new; + } + + /** + * Returns the comment + * + * @return null|string + */ + public function getComment() + { + return $this->comment; + } } From 42ecb344301d19b82483c8527614f4070b1e1988 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 3 Aug 2024 11:11:29 -0500 Subject: [PATCH 2/2] CS adjustments --- phpseclib/Crypt/Common/AsymmetricKey.php | 14 +++++------ phpseclib/Crypt/Common/Formats/Keys/PKCS8.php | 4 ++-- .../Crypt/Common/Formats/Signature/Raw.php | 4 ++-- phpseclib/Crypt/Common/StreamCipher.php | 2 +- phpseclib/Crypt/Common/SymmetricKey.php | 2 +- phpseclib/Crypt/DH.php | 8 +++---- phpseclib/Crypt/DH/Formats/Keys/PKCS8.php | 14 +++++------ phpseclib/Crypt/DH/PrivateKey.php | 2 +- phpseclib/Crypt/DSA.php | 12 +++++----- phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php | 18 +++++++------- phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php | 24 +++++++++---------- phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php | 18 +++++++------- phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php | 18 +++++++------- phpseclib/Crypt/DSA/Formats/Keys/Raw.php | 18 +++++++------- phpseclib/Crypt/DSA/Formats/Keys/XML.php | 8 +++---- .../Crypt/DSA/Formats/Signature/ASN1.php | 4 ++-- .../Crypt/DSA/Formats/Signature/SSH2.php | 4 ++-- phpseclib/Crypt/DSA/PrivateKey.php | 2 +- phpseclib/Crypt/EC.php | 8 +++---- phpseclib/Crypt/EC/BaseCurves/Base.php | 6 ++--- phpseclib/Crypt/EC/BaseCurves/Binary.php | 4 ++-- phpseclib/Crypt/EC/BaseCurves/Montgomery.php | 2 +- phpseclib/Crypt/EC/BaseCurves/Prime.php | 6 ++--- .../Crypt/EC/BaseCurves/TwistedEdwards.php | 8 +++---- phpseclib/Crypt/EC/Formats/Keys/Common.php | 8 +++---- phpseclib/Crypt/EC/Formats/Keys/JWK.php | 8 +++---- .../EC/Formats/Keys/MontgomeryPrivate.php | 6 ++--- .../EC/Formats/Keys/MontgomeryPublic.php | 2 +- phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php | 6 ++--- phpseclib/Crypt/EC/Formats/Keys/PKCS1.php | 4 ++-- phpseclib/Crypt/EC/Formats/Keys/PKCS8.php | 6 ++--- phpseclib/Crypt/EC/Formats/Keys/PuTTY.php | 6 ++--- phpseclib/Crypt/EC/Formats/Keys/XML.php | 10 ++++---- phpseclib/Crypt/EC/Formats/Keys/libsodium.php | 6 ++--- phpseclib/Crypt/EC/Formats/Signature/ASN1.php | 4 ++-- phpseclib/Crypt/EC/Formats/Signature/IEEE.php | 4 ++-- phpseclib/Crypt/EC/Formats/Signature/SSH2.php | 4 ++-- phpseclib/Crypt/Hash.php | 2 +- phpseclib/Crypt/RSA.php | 24 +++++++++---------- phpseclib/Crypt/RSA/Formats/Keys/JWK.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/PSS.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/Raw.php | 10 ++++---- phpseclib/Crypt/RSA/Formats/Keys/XML.php | 10 ++++---- phpseclib/Crypt/RSA/PrivateKey.php | 16 ++++++------- phpseclib/Crypt/RSA/PublicKey.php | 12 +++++----- phpseclib/File/ANSI.php | 2 +- phpseclib/File/ASN1/Element.php | 2 +- phpseclib/File/X509.php | 6 ++--- phpseclib/Math/BigInteger.php | 4 ++-- phpseclib/Net/SFTP.php | 2 +- phpseclib/Net/SSH2.php | 8 +++---- phpseclib/System/SSH/Agent.php | 8 +++---- phpseclib/System/SSH/Agent/Identity.php | 4 ++-- tests/Unit/Net/SSH2UnitTest.php | 4 ++-- tests/make_compatible_with_phpunit7.php | 6 ++--- tests/make_compatible_with_phpunit9.php | 6 ++--- 61 files changed, 240 insertions(+), 240 deletions(-) diff --git a/phpseclib/Crypt/Common/AsymmetricKey.php b/phpseclib/Crypt/Common/AsymmetricKey.php index 09eb5b1b..a380e43d 100644 --- a/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/phpseclib/Crypt/Common/AsymmetricKey.php @@ -30,14 +30,14 @@ abstract class AsymmetricKey /** * Precomputed Zero * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected static $zero; /** * Precomputed One * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected static $one; @@ -51,14 +51,14 @@ abstract class AsymmetricKey /** * Hash function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ protected $hash; /** * HMAC function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ private $hmac; @@ -130,7 +130,7 @@ abstract class AsymmetricKey * * @param string $key * @param string $password optional - * @return \phpseclib3\Crypt\Common\PublicKey|\phpseclib3\Crypt\Common\PrivateKey + * @return PublicKey|PrivateKey */ public static function load($key, $password = false) { @@ -531,7 +531,7 @@ abstract class AsymmetricKey /** * Integer to Octet String * - * @param \phpseclib3\Math\BigInteger $v + * @param BigInteger $v * @return string */ private function int2octets($v) @@ -551,7 +551,7 @@ abstract class AsymmetricKey * Bit String to Integer * * @param string $in - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ protected function bits2int($in) { diff --git a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php index 7aa55480..732ac5df 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php @@ -697,7 +697,7 @@ abstract class PKCS8 extends PKCS $decoded = self::preParse($key); - $r = ASN1::asn1map($decoded[0], ASN1\Maps\EncryptedPrivateKeyInfo::MAP); + $r = ASN1::asn1map($decoded[0], Maps\EncryptedPrivateKeyInfo::MAP); if (!is_array($r)) { throw new \RuntimeException('Unable to parse using EncryptedPrivateKeyInfo map'); } @@ -707,7 +707,7 @@ abstract class PKCS8 extends PKCS if (!$decoded) { throw new \RuntimeException('Unable to decode BER'); } - $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], ASN1\Maps\PBES2params::MAP); + $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], Maps\PBES2params::MAP); $kdf = &$r['encryptionAlgorithm']['parameters']['keyDerivationFunc']; switch ($kdf['algorithm']) { diff --git a/phpseclib/Crypt/Common/Formats/Signature/Raw.php b/phpseclib/Crypt/Common/Formats/Signature/Raw.php index ab8e7e46..42a65afa 100644 --- a/phpseclib/Crypt/Common/Formats/Signature/Raw.php +++ b/phpseclib/Crypt/Common/Formats/Signature/Raw.php @@ -49,8 +49,8 @@ abstract class Raw /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/Common/StreamCipher.php b/phpseclib/Crypt/Common/StreamCipher.php index 0e2d6f0c..0d969082 100644 --- a/phpseclib/Crypt/Common/StreamCipher.php +++ b/phpseclib/Crypt/Common/StreamCipher.php @@ -35,7 +35,7 @@ abstract class StreamCipher extends SymmetricKey * Default Constructor. * * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() - * @return \phpseclib3\Crypt\Common\StreamCipher + * @return StreamCipher */ public function __construct() { diff --git a/phpseclib/Crypt/Common/SymmetricKey.php b/phpseclib/Crypt/Common/SymmetricKey.php index 175508d4..35d7a7d7 100644 --- a/phpseclib/Crypt/Common/SymmetricKey.php +++ b/phpseclib/Crypt/Common/SymmetricKey.php @@ -1079,7 +1079,7 @@ abstract class SymmetricKey * * @see self::setPassword() * @param int $n - * @param \phpseclib3\Crypt\Hash $hashObj + * @param Hash $hashObj * @param string $i * @param string $d * @param int $count diff --git a/phpseclib/Crypt/DH.php b/phpseclib/Crypt/DH.php index e1deaf08..b2301986 100644 --- a/phpseclib/Crypt/DH.php +++ b/phpseclib/Crypt/DH.php @@ -49,7 +49,7 @@ abstract class DH extends AsymmetricKey /** * DH prime * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $prime; @@ -58,14 +58,14 @@ abstract class DH extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $base; /** * Public Key * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $publicKey; @@ -243,7 +243,7 @@ abstract class DH extends AsymmetricKey * * @param Parameters $params * @param int $length optional - * @return DH\PrivateKey + * @return PrivateKey */ public static function createKey(Parameters $params, $length = 0) { diff --git a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php index c330a3c7..7d02e5f3 100644 --- a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php @@ -89,10 +89,10 @@ abstract class PKCS8 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $prime - * @param \phpseclib3\Math\BigInteger $base - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Math\BigInteger $publicKey + * @param BigInteger $prime + * @param BigInteger $base + * @param BigInteger $privateKey + * @param BigInteger $publicKey * @param string $password optional * @param array $options optional * @return string @@ -112,9 +112,9 @@ abstract class PKCS8 extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $prime - * @param \phpseclib3\Math\BigInteger $base - * @param \phpseclib3\Math\BigInteger $publicKey + * @param BigInteger $prime + * @param BigInteger $base + * @param BigInteger $publicKey * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/DH/PrivateKey.php b/phpseclib/Crypt/DH/PrivateKey.php index 737781f8..e2407e35 100644 --- a/phpseclib/Crypt/DH/PrivateKey.php +++ b/phpseclib/Crypt/DH/PrivateKey.php @@ -40,7 +40,7 @@ final class PrivateKey extends DH /** * Returns the public key * - * @return DH\PublicKey + * @return PublicKey */ public function getPublicKey() { diff --git a/phpseclib/Crypt/DSA.php b/phpseclib/Crypt/DSA.php index 0123c66c..92c777d6 100644 --- a/phpseclib/Crypt/DSA.php +++ b/phpseclib/Crypt/DSA.php @@ -53,7 +53,7 @@ abstract class DSA extends AsymmetricKey /** * DSA Prime P * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $p; @@ -62,21 +62,21 @@ abstract class DSA extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $q; /** * DSA Group Generator G * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $g; /** * DSA public key value y * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $y; @@ -99,7 +99,7 @@ abstract class DSA extends AsymmetricKey * * @param int $L * @param int $N - * @return \phpseclib3\Crypt\DSA|bool + * @return DSA|bool */ public static function createParameters($L = 2048, $N = 224) { @@ -179,7 +179,7 @@ abstract class DSA extends AsymmetricKey * Returns the private key, from which the publickey can be extracted * * @param int[] ...$args - * @return DSA\PrivateKey + * @return PrivateKey */ public static function createKey(...$args) { diff --git a/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php index cc204fa9..bc41fcf5 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php @@ -65,10 +65,10 @@ abstract class OpenSSH extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @param array $options optional * @return string */ @@ -99,11 +99,11 @@ abstract class OpenSSH extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php index 52a04992..800cfb38 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php @@ -77,9 +77,9 @@ abstract class PKCS1 extends Progenitor /** * Convert DSA parameters to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g * @return string */ public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $g) @@ -100,11 +100,11 @@ abstract class PKCS1 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -128,10 +128,10 @@ abstract class PKCS1 extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php index 004881e8..238f42c2 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php @@ -99,11 +99,11 @@ abstract class PKCS8 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -124,10 +124,10 @@ abstract class PKCS8 extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php b/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php index 177bfdd4..f6177f46 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php @@ -68,11 +68,11 @@ abstract class PuTTY extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -92,10 +92,10 @@ abstract class PuTTY extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/Raw.php b/phpseclib/Crypt/DSA/Formats/Keys/Raw.php index 201aa6f9..8e2ef01f 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/Raw.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/Raw.php @@ -56,11 +56,11 @@ abstract class Raw /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y - * @param \phpseclib3\Math\BigInteger $x + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y + * @param BigInteger $x * @param string $password optional * @return string */ @@ -72,10 +72,10 @@ abstract class Raw /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/XML.php b/phpseclib/Crypt/DSA/Formats/Keys/XML.php index fc363677..f77cbf20 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/XML.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/XML.php @@ -114,10 +114,10 @@ abstract class XML * * See https://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue * - * @param \phpseclib3\Math\BigInteger $p - * @param \phpseclib3\Math\BigInteger $q - * @param \phpseclib3\Math\BigInteger $g - * @param \phpseclib3\Math\BigInteger $y + * @param BigInteger $p + * @param BigInteger $q + * @param BigInteger $g + * @param BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php b/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php index df52beed..f8006028 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php @@ -51,8 +51,8 @@ abstract class ASN1 /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php index dbfceabb..88807b5b 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php @@ -55,8 +55,8 @@ abstract class SSH2 /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/DSA/PrivateKey.php b/phpseclib/Crypt/DSA/PrivateKey.php index 74d3e69e..87cd77a7 100644 --- a/phpseclib/Crypt/DSA/PrivateKey.php +++ b/phpseclib/Crypt/DSA/PrivateKey.php @@ -28,7 +28,7 @@ final class PrivateKey extends DSA implements Common\PrivateKey /** * DSA secret exponent x * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $x; diff --git a/phpseclib/Crypt/EC.php b/phpseclib/Crypt/EC.php index 10b38254..dc82dd04 100644 --- a/phpseclib/Crypt/EC.php +++ b/phpseclib/Crypt/EC.php @@ -70,7 +70,7 @@ abstract class EC extends AsymmetricKey /** * Curve * - * @var \phpseclib3\Crypt\EC\BaseCurves\Base + * @var EC\BaseCurves\Base */ protected $curve; @@ -100,7 +100,7 @@ abstract class EC extends AsymmetricKey * * Used for deterministic ECDSA * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $q; @@ -112,7 +112,7 @@ abstract class EC extends AsymmetricKey * public key. But the x is different depending on which side of the equal sign * you're on. It's less ambiguous if you do dA * base point = (x, y)-coordinate. * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $x; @@ -134,7 +134,7 @@ abstract class EC extends AsymmetricKey * Create public / private key pair. * * @param string $curve - * @return \phpseclib3\Crypt\EC\PrivateKey + * @return PrivateKey */ public static function createKey($curve) { diff --git a/phpseclib/Crypt/EC/BaseCurves/Base.php b/phpseclib/Crypt/EC/BaseCurves/Base.php index dbc914be..d76562d0 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Base.php +++ b/phpseclib/Crypt/EC/BaseCurves/Base.php @@ -32,7 +32,7 @@ abstract class Base /** * Finite Field Integer factory * - * @var \phpseclib3\Math\FiniteField\Integer + * @var FiniteField\Integer */ protected $factory; @@ -47,7 +47,7 @@ abstract class Base } /** - * Converts a BigInteger to a \phpseclib3\Math\FiniteField\Integer integer + * Converts a BigInteger to a FiniteField\Integer integer * * @return object */ @@ -147,7 +147,7 @@ abstract class Base /** * Returns the Order * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getOrder() { diff --git a/phpseclib/Crypt/EC/BaseCurves/Binary.php b/phpseclib/Crypt/EC/BaseCurves/Binary.php index 4fc6c70c..66da11da 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Binary.php +++ b/phpseclib/Crypt/EC/BaseCurves/Binary.php @@ -35,7 +35,7 @@ class Binary extends Base /** * Binary Field Integer factory * - * @var \phpseclib3\Math\BinaryField + * @var BinaryField */ protected $factory; @@ -305,7 +305,7 @@ class Binary extends Base /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { diff --git a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php index e3fa50b3..bf02569d 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php +++ b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php @@ -39,7 +39,7 @@ class Montgomery extends Base /** * Prime Field Integer factory * - * @var \phpseclib3\Math\PrimeField + * @var PrimeField */ protected $factory; diff --git a/phpseclib/Crypt/EC/BaseCurves/Prime.php b/phpseclib/Crypt/EC/BaseCurves/Prime.php index 6250dfb0..62004017 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Prime.php +++ b/phpseclib/Crypt/EC/BaseCurves/Prime.php @@ -483,7 +483,7 @@ class Prime extends Base /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { @@ -493,7 +493,7 @@ class Prime extends Base /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getA() { @@ -503,7 +503,7 @@ class Prime extends Base /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getB() { diff --git a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php index 2521a4c0..004406ac 100644 --- a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php +++ b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php @@ -133,7 +133,7 @@ class TwistedEdwards extends Base /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getA() { @@ -143,7 +143,7 @@ class TwistedEdwards extends Base /** * Returns the a coefficient * - * @return \phpseclib3\Math\PrimeField\Integer + * @return PrimeInteger */ public function getD() { @@ -171,7 +171,7 @@ class TwistedEdwards extends Base /** * Returns the affine point * - * @return \phpseclib3\Math\PrimeField\Integer[] + * @return PrimeField\Integer[] */ public function convertToAffine(array $p) { @@ -189,7 +189,7 @@ class TwistedEdwards extends Base /** * Returns the modulo * - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ public function getModulo() { diff --git a/phpseclib/Crypt/EC/Formats/Keys/Common.php b/phpseclib/Crypt/EC/Formats/Keys/Common.php index 63402b4a..743c07c3 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/Common.php +++ b/phpseclib/Crypt/EC/Formats/Keys/Common.php @@ -183,7 +183,7 @@ trait Common * If the key contains an implicit curve phpseclib needs the curve * to be explicitly provided * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve */ public static function setImplicitCurve(BaseCurve $curve) { @@ -195,7 +195,7 @@ trait Common * on the curve parameters * * @param array $params - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ protected static function loadCurveByParam(array $params) { @@ -269,7 +269,7 @@ trait Common * Supports both compressed and uncompressed points * * @param string $str - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @return object[] */ public static function extractPoint($str, BaseCurve $curve) @@ -335,7 +335,7 @@ trait Common * Encode Parameters * * @todo Maybe at some point this could be moved to __toString() for each of the curves? - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param bool $returnArray optional * @param array $options optional * @return string|false diff --git a/phpseclib/Crypt/EC/Formats/Keys/JWK.php b/phpseclib/Crypt/EC/Formats/Keys/JWK.php index fd18a981..5bc5184f 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/JWK.php +++ b/phpseclib/Crypt/EC/Formats/Keys/JWK.php @@ -130,7 +130,7 @@ abstract class JWK extends Progenitor /** * Return the array superstructure for an EC public key * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return array */ @@ -155,7 +155,7 @@ abstract class JWK extends Progenitor /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -170,8 +170,8 @@ abstract class JWK extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php index 5741b05a..aa64f79a 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php +++ b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php @@ -71,7 +71,7 @@ abstract class MontgomeryPrivate /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ @@ -83,8 +83,8 @@ abstract class MontgomeryPrivate /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param BigInteger $privateKey + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php index d1ad48a5..257c26e8 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php +++ b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php @@ -60,7 +60,7 @@ abstract class MontgomeryPublic /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve + * @param MontgomeryCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ diff --git a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php index 2cd3e19d..0ef11604 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php @@ -134,7 +134,7 @@ abstract class OpenSSH extends Progenitor /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -171,8 +171,8 @@ abstract class OpenSSH extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php index 9f4b3300..756ffb95 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php @@ -162,8 +162,8 @@ abstract class PKCS1 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php index e5012e5d..66ec0308 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php @@ -161,7 +161,7 @@ abstract class PKCS8 extends Progenitor /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -192,8 +192,8 @@ abstract class PKCS8 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php index 866c883f..7e1e9170 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php @@ -84,8 +84,8 @@ abstract class PuTTY extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BigInteger $privateKey + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional @@ -121,7 +121,7 @@ abstract class PuTTY extends Progenitor /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField[] $publicKey * @return string */ diff --git a/phpseclib/Crypt/EC/Formats/Keys/XML.php b/phpseclib/Crypt/EC/Formats/Keys/XML.php index 27d9218f..b0cb1265 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/XML.php +++ b/phpseclib/Crypt/EC/Formats/Keys/XML.php @@ -171,7 +171,7 @@ abstract class XML * Extract points from an XML document * * @param \DOMXPath $xpath - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @return object[] */ private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve) @@ -199,7 +199,7 @@ abstract class XML * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ private static function loadCurveByParam(\DOMXPath $xpath) { @@ -279,7 +279,7 @@ abstract class XML * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false + * @return BaseCurve|false */ private static function loadCurveByParamRFC4050(\DOMXPath $xpath) { @@ -366,7 +366,7 @@ abstract class XML /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string @@ -407,7 +407,7 @@ abstract class XML /** * Encode Parameters * - * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param BaseCurve $curve * @param string $pre * @param array $options optional * @return string|false diff --git a/phpseclib/Crypt/EC/Formats/Keys/libsodium.php b/phpseclib/Crypt/EC/Formats/Keys/libsodium.php index 2be6ba59..cce37bab 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/libsodium.php +++ b/phpseclib/Crypt/EC/Formats/Keys/libsodium.php @@ -81,7 +81,7 @@ abstract class libsodium /** * Convert an EC public key to the appropriate format * - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ @@ -93,8 +93,8 @@ abstract class libsodium /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $privateKey - * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param BigInteger $privateKey + * @param Ed25519 $curve * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $secret optional * @param string $password optional diff --git a/phpseclib/Crypt/EC/Formats/Signature/ASN1.php b/phpseclib/Crypt/EC/Formats/Signature/ASN1.php index d2a80a14..385028b3 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/ASN1.php +++ b/phpseclib/Crypt/EC/Formats/Signature/ASN1.php @@ -51,8 +51,8 @@ abstract class ASN1 /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/EC/Formats/Signature/IEEE.php b/phpseclib/Crypt/EC/Formats/Signature/IEEE.php index 6bfd9311..c5e622a1 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/IEEE.php +++ b/phpseclib/Crypt/EC/Formats/Signature/IEEE.php @@ -52,8 +52,8 @@ abstract class IEEE /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @param string $curve * @param int $length * @return string diff --git a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php index e0644421..698c8e4c 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php @@ -66,8 +66,8 @@ abstract class SSH2 /** * Returns a signature in the appropriate format * - * @param \phpseclib3\Math\BigInteger $r - * @param \phpseclib3\Math\BigInteger $s + * @param BigInteger $r + * @param BigInteger $s * @param string $curve * @return string */ diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 0e02544e..61aac867 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -159,7 +159,7 @@ class Hash * umac cipher object * * @see self::hash() - * @var \phpseclib3\Crypt\AES + * @var AES */ private $c; diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 19dcfea3..9cbe6bfc 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -10,7 +10,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -26,7 +26,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -180,7 +180,7 @@ abstract class RSA extends AsymmetricKey /** * Hash function for the Mask Generation Function * - * @var \phpseclib3\Crypt\Hash + * @var Hash */ protected $mgfHash; @@ -194,21 +194,21 @@ abstract class RSA extends AsymmetricKey /** * Modulus (ie. n) * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $modulus; /** * Modulus length * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $k; /** * Exponent (ie. e or d) * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $exponent; @@ -252,7 +252,7 @@ abstract class RSA extends AsymmetricKey /** * Public Exponent * - * @var \phpseclib3\Math\BigInteger + * @var Math\BigInteger */ protected $publicExponent; @@ -297,7 +297,7 @@ abstract class RSA extends AsymmetricKey * * The public key can be extracted from the private key * - * @return RSA\PrivateKey + * @return PrivateKey * @param int $bits */ public static function createKey($bits = 2048) @@ -510,7 +510,7 @@ abstract class RSA extends AsymmetricKey * * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}. * - * @param bool|\phpseclib3\Math\BigInteger $x + * @param bool|Math\BigInteger $x * @param int $xLen * @return bool|string */ @@ -532,7 +532,7 @@ abstract class RSA extends AsymmetricKey * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}. * * @param string $x - * @return \phpseclib3\Math\BigInteger + * @return Math\BigInteger */ protected function os2ip($x) { @@ -703,7 +703,7 @@ abstract class RSA extends AsymmetricKey { $new = clone $this; - // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': @@ -738,7 +738,7 @@ abstract class RSA extends AsymmetricKey { $new = clone $this; - // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': diff --git a/phpseclib/Crypt/RSA/Formats/Keys/JWK.php b/phpseclib/Crypt/RSA/Formats/Keys/JWK.php index 87f543de..6dcf1cb0 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/JWK.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/JWK.php @@ -90,9 +90,9 @@ abstract class JWK extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -124,8 +124,8 @@ abstract class JWK extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php b/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php index e9a0c4f3..b60e48ea 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php @@ -174,9 +174,9 @@ abstract class MSBLOB /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -211,8 +211,8 @@ abstract class MSBLOB /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php index 2367810a..ca74ea48 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php @@ -90,8 +90,8 @@ abstract class OpenSSH extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ @@ -112,9 +112,9 @@ abstract class OpenSSH extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php index 276c6024..76335567 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php @@ -102,9 +102,9 @@ abstract class PKCS1 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -142,8 +142,8 @@ abstract class PKCS1 extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php index 1eaac6ef..53918bc0 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php @@ -88,9 +88,9 @@ abstract class PKCS8 extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -108,8 +108,8 @@ abstract class PKCS8 extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php index ed75b9b7..bf51bcf7 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php @@ -154,9 +154,9 @@ abstract class PSS extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -177,8 +177,8 @@ abstract class PSS extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php b/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php index fe35717b..293903ce 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php @@ -85,9 +85,9 @@ abstract class PuTTY extends Progenitor /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -110,8 +110,8 @@ abstract class PuTTY extends Progenitor /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php index db728784..55c7ccd7 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php @@ -138,9 +138,9 @@ abstract class Raw /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -173,8 +173,8 @@ abstract class Raw /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return array */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/XML.php b/phpseclib/Crypt/RSA/Formats/Keys/XML.php index 280048cc..d569dea6 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/XML.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/XML.php @@ -123,9 +123,9 @@ abstract class XML /** * Convert a private key to the appropriate format. * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e - * @param \phpseclib3\Math\BigInteger $d + * @param BigInteger $n + * @param BigInteger $e + * @param BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -157,8 +157,8 @@ abstract class XML /** * Convert a public key to the appropriate format * - * @param \phpseclib3\Math\BigInteger $n - * @param \phpseclib3\Math\BigInteger $e + * @param BigInteger $n + * @param BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/PrivateKey.php b/phpseclib/Crypt/RSA/PrivateKey.php index 37dd09a4..8c828b31 100644 --- a/phpseclib/Crypt/RSA/PrivateKey.php +++ b/phpseclib/Crypt/RSA/PrivateKey.php @@ -51,7 +51,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey /** * Private Exponent * - * @var \phpseclib3\Math\BigInteger + * @var BigInteger */ protected $privateExponent; @@ -60,7 +60,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. * - * @return bool|\phpseclib3\Math\BigInteger + * @return bool|BigInteger */ private function rsadp(BigInteger $c) { @@ -75,7 +75,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. * - * @return bool|\phpseclib3\Math\BigInteger + * @return bool|BigInteger */ private function rsasp1(BigInteger $m) { @@ -88,8 +88,8 @@ final class PrivateKey extends RSA implements Common\PrivateKey /** * Exponentiate * - * @param \phpseclib3\Math\BigInteger $x - * @return \phpseclib3\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ protected function exponentiate(BigInteger $x) { @@ -169,10 +169,10 @@ final class PrivateKey extends RSA implements Common\PrivateKey * Protects against timing attacks by employing RSA Blinding. * Returns $x->modPow($this->exponents[$i], $this->primes[$i]) * - * @param \phpseclib3\Math\BigInteger $x - * @param \phpseclib3\Math\BigInteger $r + * @param BigInteger $x + * @param BigInteger $r * @param int $i - * @return \phpseclib3\Math\BigInteger + * @return BigInteger */ private function blind(BigInteger $x, BigInteger $r, $i) { diff --git a/phpseclib/Crypt/RSA/PublicKey.php b/phpseclib/Crypt/RSA/PublicKey.php index 58939a9f..ff80ae79 100644 --- a/phpseclib/Crypt/RSA/PublicKey.php +++ b/phpseclib/Crypt/RSA/PublicKey.php @@ -35,8 +35,8 @@ final class PublicKey extends RSA implements Common\PublicKey /** * Exponentiate * - * @param \phpseclib3\Math\BigInteger $x - * @return \phpseclib3\Math\BigInteger + * @param BigInteger $x + * @return BigInteger */ private function exponentiate(BigInteger $x) { @@ -48,8 +48,8 @@ final class PublicKey extends RSA implements Common\PublicKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}. * - * @param \phpseclib3\Math\BigInteger $s - * @return bool|\phpseclib3\Math\BigInteger + * @param BigInteger $s + * @return bool|BigInteger */ private function rsavp1($s) { @@ -405,8 +405,8 @@ final class PublicKey extends RSA implements Common\PublicKey * * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}. * - * @param \phpseclib3\Math\BigInteger $m - * @return bool|\phpseclib3\Math\BigInteger + * @param BigInteger $m + * @return bool|BigInteger */ private function rsaep($m) { diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 5803a372..41477ba5 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -140,7 +140,7 @@ class ANSI /** * Default Constructor. * - * @return \phpseclib3\File\ANSI + * @return ANSI */ public function __construct() { diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php index 6540b421..ae4b764b 100644 --- a/phpseclib/File/ASN1/Element.php +++ b/phpseclib/File/ASN1/Element.php @@ -34,7 +34,7 @@ class Element * Constructor * * @param string $encoded - * @return \phpseclib3\File\ASN1\Element + * @return Element */ public function __construct($encoded) { diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 5e2f073f..18d2f53e 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -272,7 +272,7 @@ class X509 /** * Default Constructor. * - * @return \phpseclib3\File\X509 + * @return X509 */ public function __construct() { @@ -1390,7 +1390,7 @@ class X509 * @param string $signatureAlgorithm * @param string $signature * @param string $signatureSubject - * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws UnsupportedAlgorithmException if the algorithm is unsupported * @return bool */ private function validateSignatureHelper($publicKeyAlgorithm, $publicKey, $signatureAlgorithm, $signature, $signatureSubject) @@ -2972,7 +2972,7 @@ class X509 * Identify signature algorithm from key settings * * @param PrivateKey $key - * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws UnsupportedAlgorithmException if the algorithm is unsupported * @return array */ private static function identifySignatureAlgorithm(PrivateKey $key) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 67d4788f..2a9cc0b4 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -162,7 +162,7 @@ class BigInteger implements \JsonSerializable * 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. * - * @param string|int|BigInteger\Engines\Engine $x Base-10 number or base-$base number if $base set. + * @param string|int|Engine $x Base-10 number or base-$base number if $base set. * @param int $base */ public function __construct($x = 0, $base = 10) @@ -171,7 +171,7 @@ class BigInteger implements \JsonSerializable if ($x instanceof self::$mainEngine) { $this->value = clone $x; - } elseif ($x instanceof BigInteger\Engines\Engine) { + } elseif ($x instanceof Engine) { $this->value = new static("$x"); $this->value->setPrecision($x->getPrecision()); } else { diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index be243259..caf2a0a3 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2101,7 +2101,7 @@ class SFTP extends SSH2 * @param callable|null $progressCallback * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \BadFunctionCallException if you're uploading via a callback and the callback function is invalid - * @throws \phpseclib3\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist + * @throws FileNotFoundException if you're uploading via a file and the file doesn't exist * @return bool */ public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 0c096d76..abecf767 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1523,7 +1523,7 @@ class SSH2 * @param string|bool $kexinit_payload_server optional * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \RuntimeException on other errors - * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible + * @throws NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible */ private function key_exchange($kexinit_payload_server = false) { @@ -2576,7 +2576,7 @@ class SSH2 * Login with an ssh-agent provided key * * @param string $username - * @param \phpseclib3\System\SSH\Agent $agent + * @param Agent $agent * @return bool */ private function ssh_agent_login($username, Agent $agent) @@ -2601,7 +2601,7 @@ class SSH2 * by sending dummy SSH_MSG_IGNORE messages.} * * @param string $username - * @param \phpseclib3\Crypt\Common\PrivateKey $privatekey + * @param PrivateKey $privatekey * @return bool * @throws \RuntimeException on connection error */ @@ -5171,7 +5171,7 @@ class SSH2 * * @return string|false * @throws \RuntimeException on badly formatted keys - * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format + * @throws NoSupportedAlgorithmsException when the key isn't in a supported format */ public function getServerPublicHostKey() { diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index 7897c8f7..376d77bf 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -111,8 +111,8 @@ class Agent /** * Default Constructor * - * @return \phpseclib3\System\SSH\Agent - * @throws \phpseclib3\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found + * @return Agent + * @throws BadConfigurationException if SSH_AUTH_SOCK cannot be found * @throws \RuntimeException on connection errors */ public function __construct($address = null) @@ -237,7 +237,7 @@ class Agent /** * Request agent forwarding of remote server * - * @param \phpseclib3\Net\SSH2 $ssh + * @param SSH2 $ssh * @return bool */ private function request_forwarding(SSH2 $ssh) @@ -258,7 +258,7 @@ class Agent * open to give the SSH Agent an opportunity * to take further action. i.e. request agent forwarding * - * @param \phpseclib3\Net\SSH2 $ssh + * @param SSH2 $ssh */ public function registerChannelOpen(SSH2 $ssh) { diff --git a/phpseclib/System/SSH/Agent/Identity.php b/phpseclib/System/SSH/Agent/Identity.php index ed4214f3..06a4bafd 100644 --- a/phpseclib/System/SSH/Agent/Identity.php +++ b/phpseclib/System/SSH/Agent/Identity.php @@ -113,7 +113,7 @@ class Identity implements PrivateKey * * Called by \phpseclib3\System\SSH\Agent::requestIdentities() * - * @param \phpseclib3\Crypt\Common\PublicKey $key + * @param PublicKey $key */ public function withPublicKey(PublicKey $key) { @@ -267,7 +267,7 @@ class Identity implements PrivateKey * @param string $message * @return string * @throws \RuntimeException on connection errors - * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws UnsupportedAlgorithmException if the algorithm is unsupported */ public function sign($message) { diff --git a/tests/Unit/Net/SSH2UnitTest.php b/tests/Unit/Net/SSH2UnitTest.php index d8d3951d..4daed639 100644 --- a/tests/Unit/Net/SSH2UnitTest.php +++ b/tests/Unit/Net/SSH2UnitTest.php @@ -140,7 +140,7 @@ class SSH2UnitTest extends PhpseclibTestCase public function testGetConnectionByResourceId() { $ssh = new SSH2('localhost'); - $this->assertSame($ssh, \phpseclib3\Net\SSH2::getConnectionByResourceId($ssh->getResourceId())); + $this->assertSame($ssh, SSH2::getConnectionByResourceId($ssh->getResourceId())); } public function testGetResourceId() @@ -384,7 +384,7 @@ class SSH2UnitTest extends PhpseclibTestCase } /** - * @return \phpseclib3\Net\SSH2 + * @return SSH2 */ protected function createSSHMock() { diff --git a/tests/make_compatible_with_phpunit7.php b/tests/make_compatible_with_phpunit7.php index deb68aca..af7ab6b5 100644 --- a/tests/make_compatible_with_phpunit7.php +++ b/tests/make_compatible_with_phpunit7.php @@ -1,12 +1,12 @@ $files */ -$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__)); +$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__)); foreach ($files as $file) { if ($file->getExtension() === 'php' && $file->getPathname() !== __FILE__) { $fileContents = file_get_contents($file->getPathname()); if ($fileContents === false) { - throw new \RuntimeException('file_get_contents() failed: ' . $file->getPathname()); + throw new RuntimeException('file_get_contents() failed: ' . $file->getPathname()); } $patternToReplacementMap = [ '~ function setUpBeforeClass\(\)~' => ' function setUpBeforeClass(): void', @@ -25,7 +25,7 @@ foreach ($files as $file) { $fileContents ); if (file_put_contents($file->getPathname(), $updatedFileContents) === false) { - throw new \RuntimeException('file_put_contents() failed: ' . $file->getPathname()); + throw new RuntimeException('file_put_contents() failed: ' . $file->getPathname()); } } } diff --git a/tests/make_compatible_with_phpunit9.php b/tests/make_compatible_with_phpunit9.php index db04795d..6df2d2ea 100644 --- a/tests/make_compatible_with_phpunit9.php +++ b/tests/make_compatible_with_phpunit9.php @@ -1,12 +1,12 @@ $files */ -$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__)); +$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__)); foreach ($files as $file) { if ($file->getExtension() === 'php' && $file->getPathname() !== __FILE__) { $fileContents = file_get_contents($file->getPathname()); if ($fileContents === false) { - throw new \RuntimeException('file_get_contents() failed: ' . $file->getPathname()); + throw new RuntimeException('file_get_contents() failed: ' . $file->getPathname()); } $patternToReplacementMap = [ '~ function assertMatchesRegularExpression\(\$pattern, \$string, \$message = \'\'\)~' => ' function _assertMatchesRegularExpression(string $pattern, string $string, string $message = \'\')', @@ -17,7 +17,7 @@ foreach ($files as $file) { $fileContents ); if (file_put_contents($file->getPathname(), $updatedFileContents) === false) { - throw new \RuntimeException('file_put_contents() failed: ' . $file->getPathname()); + throw new RuntimeException('file_put_contents() failed: ' . $file->getPathname()); } } }