Skip to content

Commit

Permalink
fix: refactor constructor Key to use PHP 8.0 syntax (#577)
Browse files Browse the repository at this point in the history
Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
margar-melkonyan and bshaffer authored Nov 24, 2024
1 parent 30c19ed commit 29fa2ce
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 29fa2ce

Please sign in to comment.