Skip to content

Commit e94a387

Browse files
authored
Merge pull request #4 from IlicMiljan/add-cipher-exception-tests
Add Cipher Exceptions Unit Tests
2 parents 55814cc + 15ab6ee commit e94a387

16 files changed

+178
-18
lines changed

src/Cipher/AdvancedEncryptionStandardCipher.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace IlicMiljan\SecureProps\Cipher;
44

5-
use IlicMiljan\SecureProps\Reader\Exception\FailedCalculatingInitializationVectorLength;
6-
use IlicMiljan\SecureProps\Reader\Exception\FailedDecryptingValue;
7-
use IlicMiljan\SecureProps\Reader\Exception\FailedEncryptingValue;
8-
use IlicMiljan\SecureProps\Reader\Exception\FailedGeneratingInitializationVector;
5+
use IlicMiljan\SecureProps\Cipher\Exception\FailedCalculatingInitializationVectorLength;
6+
use IlicMiljan\SecureProps\Cipher\Exception\FailedDecryptingValue;
7+
use IlicMiljan\SecureProps\Cipher\Exception\FailedEncryptingValue;
8+
use IlicMiljan\SecureProps\Cipher\Exception\FailedGeneratingInitializationVector;
99
use InvalidArgumentException;
1010
use SensitiveParameter;
1111

src/Cipher/AsymmetricEncryptionCipher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace IlicMiljan\SecureProps\Cipher;
44

5-
use IlicMiljan\SecureProps\Reader\Exception\FailedDecryptingValue;
6-
use IlicMiljan\SecureProps\Reader\Exception\FailedEncryptingValue;
5+
use IlicMiljan\SecureProps\Cipher\Exception\FailedDecryptingValue;
6+
use IlicMiljan\SecureProps\Cipher\Exception\FailedEncryptingValue;
77
use SensitiveParameter;
88

99
class AsymmetricEncryptionCipher implements Cipher

src/Cipher/Cipher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace IlicMiljan\SecureProps\Cipher;
44

5-
use IlicMiljan\SecureProps\Reader\Exception\CipherException;
5+
use IlicMiljan\SecureProps\Cipher\Exception\CipherException;
66
use SensitiveParameter;
77

88
interface Cipher

src/Cipher/Exception/CipherException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IlicMiljan\SecureProps\Reader\Exception;
3+
namespace IlicMiljan\SecureProps\Cipher\Exception;
44

55
use Throwable;
66

src/Cipher/Exception/FailedCalculatingInitializationVectorLength.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IlicMiljan\SecureProps\Reader\Exception;
3+
namespace IlicMiljan\SecureProps\Cipher\Exception;
44

55
use LogicException;
66
use RuntimeException;

src/Cipher/Exception/FailedDecryptingValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IlicMiljan\SecureProps\Reader\Exception;
3+
namespace IlicMiljan\SecureProps\Cipher\Exception;
44

55
use LogicException;
66
use RuntimeException;

src/Cipher/Exception/FailedEncryptingValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IlicMiljan\SecureProps\Reader\Exception;
3+
namespace IlicMiljan\SecureProps\Cipher\Exception;
44

55
use LogicException;
66
use RuntimeException;

src/Cipher/Exception/FailedGeneratingInitializationVector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace IlicMiljan\SecureProps\Reader\Exception;
3+
namespace IlicMiljan\SecureProps\Cipher\Exception;
44

55
use LogicException;
66
use RuntimeException;

src/ObjectEncryptionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use IlicMiljan\SecureProps\Attribute\Encrypted;
66
use IlicMiljan\SecureProps\Cipher\Cipher;
7-
use IlicMiljan\SecureProps\Reader\Exception\CipherException;
7+
use IlicMiljan\SecureProps\Cipher\Exception\CipherException;
88
use IlicMiljan\SecureProps\Reader\Exception\ReaderException;
99
use IlicMiljan\SecureProps\Reader\ObjectPropertiesReader;
1010
use InvalidArgumentException;

src/StringEncryptionService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace IlicMiljan\SecureProps;
44

55
use IlicMiljan\SecureProps\Cipher\Cipher;
6+
use IlicMiljan\SecureProps\Cipher\Exception\CipherException;
67
use InvalidArgumentException;
78
use SensitiveParameter;
89

@@ -16,7 +17,7 @@ public function __construct(
1617
/**
1718
* @param mixed $value
1819
* @return string
19-
* @throws Reader\Exception\CipherException
20+
* @throws CipherException
2021
*/
2122
public function encrypt(#[SensitiveParameter] mixed $value): string
2223
{
@@ -30,7 +31,7 @@ public function encrypt(#[SensitiveParameter] mixed $value): string
3031
/**
3132
* @param mixed $value
3233
* @return string
33-
* @throws Reader\Exception\CipherException
34+
* @throws CipherException
3435
*/
3536
public function decrypt(#[SensitiveParameter] mixed $value): string
3637
{

0 commit comments

Comments
 (0)