@@ -46,7 +46,7 @@ class OCSPRequest extends CMSBase
4646 * @return OCSPRequest
4747 * @throws FormatException
4848 */
49- public static function createFromContent (string $ content )
49+ public static function createFromContent (string $ content ): self
5050 {
5151 return new self (self ::makeFromContent ($ content , Maps \OCSPRequest::class, Sequence::class));
5252 }
@@ -59,7 +59,7 @@ public static function createFromContent(string $content)
5959 * @return OCSPRequest
6060 * @throws FormatException
6161 */
62- public static function createSimple (Certificate $ publicCertificate , Certificate $ intermediateCertificate , string $ hashAlgorithmOID = Algorithm::OID_SHA1 )
62+ public static function createSimple (Certificate $ publicCertificate , Certificate $ intermediateCertificate , string $ hashAlgorithmOID = Algorithm::OID_SHA1 ): self
6363 {
6464 /** @see Maps\TBSRequest */
6565 $ tbsRequest = Sequence::create ([
@@ -111,7 +111,7 @@ public static function createSimple(Certificate $publicCertificate, Certificate
111111 )
112112 ]
113113 );
114- // TODO: signature create and test
114+
115115 return new self (Sequence::create ([$ tbsRequest/*, $optionalSignature*/ ]));
116116 }
117117
@@ -120,15 +120,15 @@ public static function createSimple(Certificate $publicCertificate, Certificate
120120 * @return string
121121 * @throws Exception
122122 */
123- protected static function generateNonce (int $ length = null )
123+ protected static function generateNonce (int $ length = null ): string
124124 {
125125 return random_bytes ($ length ?? self ::OCSP_DEFAULT_NONCE_LENGTH );
126126 }
127127
128128 /**
129129 * @return TBSRequest
130130 */
131- public function getTBSRequest ()
131+ public function getTBSRequest (): TBSRequest
132132 {
133133 return new TBSRequest ($ this ->object ->getChildren ()[0 ]);
134134 }
@@ -137,7 +137,7 @@ public function getTBSRequest()
137137 * @return Signature|null
138138 * @throws ParserException
139139 */
140- public function getOptionalSignature ()
140+ public function getOptionalSignature (): ? Signature
141141 {
142142 $ children = $ this ->object ->getChildren ();
143143
0 commit comments