Skip to content

Commit 2fde5f7

Browse files
authored
Merge pull request #1 from lou-perret/master
Fix deprecations on PHP 8.1
2 parents bd4f449 + e70eff3 commit 2fde5f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Asn1/Der/Encoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ protected function encodeType($typeID, $class, $isConstructed)
296296
/**
297297
* Encode the length of the encoded value of an element.
298298
*
299-
* @param string $encodedElementValue the encoded value of an element
299+
* @param ?string $encodedElementValue the encoded value of an element
300300
*
301301
* @return string
302302
*/
303303
protected function encodeLength($encodedElementValue)
304304
{
305-
$length = strlen($encodedElementValue);
305+
$length = $encodedElementValue === null ? 0 : strlen($encodedElementValue);
306306
if ($length < 128) {
307307
return chr($length);
308308
}

0 commit comments

Comments
 (0)