From 3d0205577778458547fcf884ec8d96a79f004b8a Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 22 Sep 2024 00:00:40 +0300 Subject: [PATCH] Refactor constructor Key.php to use PHP 8.0 syntax --- src/Key.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Key.php b/src/Key.php index 00cf7f2e..b34eae25 100644 --- a/src/Key.php +++ b/src/Key.php @@ -9,18 +9,13 @@ class Key { - /** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */ - private $keyMaterial; - /** @var string */ - private $algorithm; - /** * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial * @param string $algorithm */ public function __construct( - $keyMaterial, - string $algorithm + private $keyMaterial, + private string $algorithm ) { if ( !\is_string($keyMaterial) @@ -38,10 +33,6 @@ public function __construct( if (empty($algorithm)) { throw new InvalidArgumentException('Algorithm must not be empty'); } - - // TODO: Remove in PHP 8.0 in favor of class constructor property promotion - $this->keyMaterial = $keyMaterial; - $this->algorithm = $algorithm; } /**