Skip to content

Commit a42b779

Browse files
committed
refactor: use service helper for encrypted cast
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent 568b2e8 commit a42b779

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

system/DataCaster/Cast/EncryptedCast.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace CodeIgniter\DataCaster\Cast;
1515

1616
use CodeIgniter\DataCaster\Exceptions\CastException;
17-
use Config\Services;
1817
use SensitiveParameter;
1918

2019
/**
@@ -45,7 +44,7 @@ public static function get(
4544
throw CastException::forInvalidEncryptedPayload();
4645
}
4746

48-
return Services::encrypter()->decrypt($decoded);
47+
return service('encrypter')->decrypt($decoded);
4948
}
5049

5150
public static function set(
@@ -62,6 +61,6 @@ public static function set(
6261
throw CastException::forInvalidEncryptedValueType();
6362
}
6463

65-
return base64_encode(Services::encrypter()->encrypt($value));
64+
return base64_encode(service('encrypter')->encrypt($value));
6665
}
6766
}

0 commit comments

Comments
 (0)