@@ -16,19 +16,19 @@ class Certificate
1616 use LocalFileOpenTrait;
1717
1818 /** @var string PEM contents including headers */
19- private $ pem ;
19+ private string $ pem ;
2020
2121 /** @var string RFC as parsed from subject/x500UniqueIdentifier */
22- private $ rfc ;
22+ private string $ rfc ;
2323
2424 /** @var string Legal name as parsed from subject/x500UniqueIdentifier */
25- private $ legalName ;
25+ private string $ legalName ;
2626
2727 /** @var SerialNumber|null Parsed serial number */
28- private $ serialNumber ;
28+ private ? SerialNumber $ serialNumber = null ;
2929
3030 /** @var PublicKey|null Parsed public key */
31- private $ publicKey ;
31+ private ? PublicKey $ publicKey = null ;
3232
3333 /**
3434 * Certificate constructor
@@ -59,7 +59,6 @@ public function __construct(string $contents)
5959 * Convert X.509 DER base64 or X.509 DER to X.509 PEM
6060 *
6161 * @param string $contents can be a certificate format X.509 DER or X.509 DER base64
62- * @return string
6362 */
6463 public static function convertDerToPem (string $ contents ): string
6564 {
@@ -77,7 +76,6 @@ public static function convertDerToPem(string $contents): string
7776 * The content file can be a certificate format X.509 PEM, X.509 DER or X.509 DER base64
7877 *
7978 * @param string $filename must be a local file (without scheme or file:// scheme)
80- * @return Certificate
8179 */
8280 public static function openFile (string $ filename ): self
8381 {
@@ -230,12 +228,12 @@ public function satType(): SatTypeEnum
230228 return SatTypeEnum::csd ();
231229 }
232230
233- public function validOn (DateTimeImmutable $ datetime = null ): bool
231+ public function validOn (? DateTimeImmutable $ datetime = null ): bool
234232 {
235233 if (null === $ datetime ) {
236234 $ datetime = new DateTimeImmutable ();
237235 }
238- return ( $ datetime >= $ this ->validFromDateTime () && $ datetime <= $ this ->validToDateTime () );
236+ return $ datetime >= $ this ->validFromDateTime () && $ datetime <= $ this ->validToDateTime ();
239237 }
240238
241239 protected function createSerialNumber (string $ hexadecimal , string $ decimal ): SerialNumber
0 commit comments