Skip to content

Commit 751a02d

Browse files
committed
Add return type
1 parent b548742 commit 751a02d

16 files changed

+68
-20
lines changed

lib/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ public function name(): string
270270

271271
/**
272272
* {@inheritdoc}
273+
*
274+
* @return self
273275
*/
274-
public static function fromASN1Params(?UnspecifiedType $params = null)
276+
public static function fromASN1Params(
277+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
275278
{
276279
if (!isset($params)) {
277280
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ public function name(): string
4343

4444
/**
4545
* {@inheritdoc}
46+
*
47+
* @return self
4648
*/
47-
public static function fromASN1Params(?UnspecifiedType $params = null)
49+
public static function fromASN1Params(
50+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
4851
{
4952
if (!isset($params)) {
5053
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Cipher/AESCBCAlgorithmIdentifier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sop\ASN1\Element;
88
use Sop\ASN1\Type\Primitive\OctetString;
99
use Sop\ASN1\Type\UnspecifiedType;
10+
use Sop\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier;
1011

1112
/*
1213
From RFC 3565 - 4.1. AES Algorithm Identifiers and Parameters:
@@ -36,13 +37,12 @@ public function __construct(?string $iv = null)
3637
}
3738

3839
/**
39-
* @param UnspecifiedType $params
40-
*
41-
* @throws \UnexpectedValueException If parameters are invalid
40+
* {@inheritdoc}
4241
*
4342
* @return self
4443
*/
45-
public static function fromASN1Params(?UnspecifiedType $params = null)
44+
public static function fromASN1Params(
45+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
4646
{
4747
if (!isset($params)) {
4848
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sop\ASN1\Element;
88
use Sop\ASN1\Type\Primitive\OctetString;
99
use Sop\ASN1\Type\UnspecifiedType;
10+
use Sop\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier;
1011

1112
/*
1213
RFC 2898 defines parameters as follows:
@@ -45,8 +46,11 @@ public function name(): string
4546

4647
/**
4748
* {@inheritdoc}
49+
*
50+
* @return self
4851
*/
49-
public static function fromASN1Params(?UnspecifiedType $params = null)
52+
public static function fromASN1Params(
53+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
5054
{
5155
if (!isset($params)) {
5256
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sop\ASN1\Element;
88
use Sop\ASN1\Type\Primitive\OctetString;
99
use Sop\ASN1\Type\UnspecifiedType;
10+
use Sop\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier;
1011

1112
/*
1213
RFC 2898 defines parameters as follows:
@@ -46,8 +47,11 @@ public function name(): string
4647

4748
/**
4849
* {@inheritdoc}
50+
*
51+
* @return self
4952
*/
50-
public static function fromASN1Params(?UnspecifiedType $params = null)
53+
public static function fromASN1Params(
54+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
5155
{
5256
if (!isset($params)) {
5357
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Sop\ASN1\Type\Primitive\Integer;
1010
use Sop\ASN1\Type\Primitive\OctetString;
1111
use Sop\ASN1\Type\UnspecifiedType;
12+
use Sop\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier;
1213

1314
/*
1415
Parameters may be seen in various forms. This implementation attemts
@@ -107,8 +108,11 @@ public function name(): string
107108

108109
/**
109110
* {@inheritdoc}
111+
*
112+
* @return self
110113
*/
111-
public static function fromASN1Params(?UnspecifiedType $params = null)
114+
public static function fromASN1Params(
115+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
112116
{
113117
if (!isset($params)) {
114118
throw new \UnexpectedValueException('No parameters.');

lib/CryptoTypes/AlgorithmIdentifier/Hash/HMACWithSHA1AlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ public function name(): string
4444

4545
/**
4646
* {@inheritdoc}
47+
*
48+
* @return self
4749
*/
48-
public static function fromASN1Params(?UnspecifiedType $params = null)
50+
public static function fromASN1Params(
51+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
4952
{
5053
if (isset($params)) {
5154
throw new \UnexpectedValueException('Parameters must be omitted.');

lib/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ public function name(): string
5959

6060
/**
6161
* {@inheritdoc}
62+
*
63+
* @return self
6264
*/
63-
public static function fromASN1Params(?UnspecifiedType $params = null)
65+
public static function fromASN1Params(
66+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
6467
{
6568
$obj = new static();
6669
// if parameters field is present, it must be null type

lib/CryptoTypes/AlgorithmIdentifier/Hash/RFC4231HMACAlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ abstract class RFC4231HMACAlgorithmIdentifier extends SpecificAlgorithmIdentifie
2626

2727
/**
2828
* {@inheritdoc}
29+
*
30+
* @return self
2931
*/
30-
public static function fromASN1Params(?UnspecifiedType $params = null)
32+
public static function fromASN1Params(
33+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
3134
{
3235
/*
3336
* RFC 4231 states that the "parameter" component SHOULD be present

lib/CryptoTypes/AlgorithmIdentifier/Hash/SHA1AlgorithmIdentifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ public function name(): string
5454

5555
/**
5656
* {@inheritdoc}
57+
*
58+
* @return self
5759
*/
58-
public static function fromASN1Params(?UnspecifiedType $params = null)
60+
public static function fromASN1Params(
61+
?UnspecifiedType $params = null): SpecificAlgorithmIdentifier
5962
{
6063
$obj = new static();
6164
// if parameters field is present, it must be null type

0 commit comments

Comments
 (0)