Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

Commit cdec871

Browse files
committed
master small refactor
1 parent 21db6dd commit cdec871

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/MysqlEncryptionServiceProvider.php

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

33
namespace IonGhitun\MysqlEncryption;
44

5+
use Exception;
56
use Illuminate\Support\Facades\DB;
67
use Illuminate\Support\Facades\Validator;
78
use Illuminate\Support\ServiceProvider;
@@ -31,7 +32,7 @@ private function addValidators()
3132
*/
3233
Validator::extend('unique_encrypted', function ($attribute, $value, array $parameters) {
3334
if (!isset($parameters[0])) {
34-
throw new \Exception('unique_encrypted requires at least one parameter');
35+
throw new Exception('unique_encrypted requires at least one parameter');
3536
}
3637

3738
$field = isset($parameters[1]) ? $parameters[1] : $attribute;
@@ -46,7 +47,7 @@ private function addValidators()
4647
*/
4748
Validator::extend('exists_encrypted', function ($attribute, $value, array $parameters) {
4849
if (!isset($parameters[0])) {
49-
throw new \Exception('exists_encrypted requires at least one parameter');
50+
throw new Exception('exists_encrypted requires at least one parameter');
5051
}
5152

5253
$field = isset($parameters[1]) ? $parameters[1] : $attribute;

tests/Models/BaseModelTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use IonGhitun\MysqlEncryption\Models\BaseModel;
77
use PHPUnit\Framework\TestCase;
88
use ReflectionClass;
9+
use ReflectionException;
910

1011
/**
1112
* Class BaseModelTest
@@ -49,7 +50,7 @@ public function tesBaseGetAttribute()
4950
/**
5051
* Test getAttribute
5152
*
52-
* @throws \ReflectionException
53+
* @throws ReflectionException
5354
*/
5455
public function testEncryptedGetAttribute()
5556
{
@@ -82,7 +83,7 @@ public function testToArray()
8283
/**
8384
* Test toArray
8485
*
85-
* @throws \ReflectionException
86+
* @throws ReflectionException
8687
*/
8788
public function testEncryptedToArray()
8889
{
@@ -113,7 +114,7 @@ public function testGetOriginal()
113114
/**
114115
* Test anonymize
115116
*
116-
* @throws \ReflectionException
117+
* @throws ReflectionException
117118
*/
118119
public function testAnonymize()
119120
{

0 commit comments

Comments
 (0)