Skip to content

Commit 29fa2ce

Browse files
fix: refactor constructor Key to use PHP 8.0 syntax (#577)
Co-authored-by: Brent Shaffer <[email protected]>
1 parent 30c19ed commit 29fa2ce

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/Key.php

+2-11
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,13 @@
99

1010
class Key
1111
{
12-
/** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */
13-
private $keyMaterial;
14-
/** @var string */
15-
private $algorithm;
16-
1712
/**
1813
* @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial
1914
* @param string $algorithm
2015
*/
2116
public function __construct(
22-
$keyMaterial,
23-
string $algorithm
17+
private $keyMaterial,
18+
private string $algorithm
2419
) {
2520
if (
2621
!\is_string($keyMaterial)
@@ -38,10 +33,6 @@ public function __construct(
3833
if (empty($algorithm)) {
3934
throw new InvalidArgumentException('Algorithm must not be empty');
4035
}
41-
42-
// TODO: Remove in PHP 8.0 in favor of class constructor property promotion
43-
$this->keyMaterial = $keyMaterial;
44-
$this->algorithm = $algorithm;
4536
}
4637

4738
/**

0 commit comments

Comments
 (0)