Skip to content

Commit 40ca8fb

Browse files
committed
Restyle
1 parent b302ba2 commit 40ca8fb

File tree

9 files changed

+26
-13
lines changed

9 files changed

+26
-13
lines changed

src/adapters/flysystem/tests/FlysystemAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
);
4040

4141
foreach ($iterator as $file) {
42-
assert($file instanceof \SplFileInfo);
42+
assert($file instanceof SplFileInfo);
4343
if ($file->isDir()) {
4444
rmdir($file->getPathname());
4545
} else {

src/plugins/data-integrity/phpseclib/tests/EcSigningAlgorithmTest.php

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

55
use KDuma\SimpleDAL\DataIntegrity\PhpSecLib\EcSigningAlgorithm;
66
use phpseclib3\Crypt\EC;
7+
use phpseclib3\Crypt\EC\PublicKey;
78

89
test('sign and verify round-trip with Ed25519', function () {
910
$privateKey = EC::createKey('Ed25519');
@@ -30,7 +31,7 @@
3031
test('verify-only mode throws on sign', function () {
3132
$privateKey = EC::createKey('Ed25519');
3233
$publicKey = $privateKey->getPublicKey();
33-
assert($publicKey instanceof \phpseclib3\Crypt\EC\PublicKey);
34+
assert($publicKey instanceof PublicKey);
3435

3536
$algo = new EcSigningAlgorithm('ec-key', $publicKey);
3637

src/plugins/data-integrity/phpseclib/tests/RsaSigningAlgorithmTest.php

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

55
use KDuma\SimpleDAL\DataIntegrity\PhpSecLib\RsaSigningAlgorithm;
66
use phpseclib3\Crypt\RSA;
7+
use phpseclib3\Crypt\RSA\PrivateKey;
8+
use phpseclib3\Crypt\RSA\PublicKey;
79

810
test('sign and verify round-trip with RSA', function () {
911
$privateKey = RSA::createKey(2048);
@@ -19,7 +21,7 @@
1921
test('verify-only mode throws on sign', function () {
2022
$privateKey = RSA::createKey(2048);
2123
$publicKey = $privateKey->getPublicKey();
22-
assert($publicKey instanceof \phpseclib3\Crypt\RSA\PublicKey);
24+
assert($publicKey instanceof PublicKey);
2325

2426
$algo = new RsaSigningAlgorithm('rsa-key', $publicKey);
2527

@@ -48,7 +50,7 @@
4850

4951
test('works with PSS padding', function () {
5052
$privateKey = RSA::createKey(2048)->withPadding(RSA::SIGNATURE_PSS);
51-
assert($privateKey instanceof \phpseclib3\Crypt\RSA\PrivateKey);
53+
assert($privateKey instanceof PrivateKey);
5254

5355
$algo = new RsaSigningAlgorithm('rsa-pss', $privateKey);
5456

src/plugins/encryption/phpseclib/tests/RsaAlgorithmTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use KDuma\SimpleDAL\Encryption\Contracts\Exception\DecryptionException;
66
use KDuma\SimpleDAL\Encryption\PhpSecLib\RsaAlgorithm;
77
use phpseclib3\Crypt\RSA;
8+
use phpseclib3\Crypt\RSA\PrivateKey;
9+
use phpseclib3\Crypt\RSA\PublicKey;
810

911
test('encrypt and decrypt round-trip with RSA OAEP', function () {
1012
$privateKey = RSA::createKey(2048);
@@ -20,7 +22,7 @@
2022
test('encrypt-only mode throws on decrypt', function () {
2123
$privateKey = RSA::createKey(2048);
2224
$publicKey = $privateKey->getPublicKey();
23-
assert($publicKey instanceof \phpseclib3\Crypt\RSA\PublicKey);
25+
assert($publicKey instanceof PublicKey);
2426

2527
$key = new RsaAlgorithm('rsa-key', $publicKey);
2628

@@ -41,7 +43,7 @@
4143

4244
test('encrypt and decrypt with PKCS1 padding', function () {
4345
$privateKey = RSA::createKey(2048)->withPadding(RSA::ENCRYPTION_PKCS1);
44-
assert($privateKey instanceof \phpseclib3\Crypt\RSA\PrivateKey);
46+
assert($privateKey instanceof PrivateKey);
4547

4648
$key = new RsaAlgorithm('rsa-pkcs1', $privateKey);
4749

src/plugins/typed/contracts/src/TypedRecord.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace KDuma\SimpleDAL\Typed\Contracts;
66

7+
use KDuma\SimpleDAL\Typed\FieldMapping;
8+
79
abstract class TypedRecord
810
{
911
public readonly string $id;
@@ -15,7 +17,7 @@ abstract class TypedRecord
1517
/** @var array<string, mixed> Non-mapped extra data fields */
1618
private array $_extraData = [];
1719

18-
/** @var list<\KDuma\SimpleDAL\Typed\FieldMapping> Field mappings -- set by the hydrator, not by the constructor */
20+
/** @var list<FieldMapping> Field mappings -- set by the hydrator, not by the constructor */
1921
private array $_fieldMappings = [];
2022

2123
/**
@@ -73,6 +75,7 @@ protected function setRawField(string $path, mixed $value): void
7375

7476
/**
7577
* @internal
78+
*
7679
* @param array<string, mixed> $data
7780
*/
7881
public function _setExtraData(array $data): void
@@ -82,6 +85,7 @@ public function _setExtraData(array $data): void
8285

8386
/**
8487
* @internal
88+
*
8589
* @return array<string, mixed>
8690
*/
8791
public function _getExtraData(): array
@@ -91,7 +95,8 @@ public function _getExtraData(): array
9195

9296
/**
9397
* @internal
94-
* @param list<\KDuma\SimpleDAL\Typed\FieldMapping> $mappings
98+
*
99+
* @param list<FieldMapping> $mappings
95100
*/
96101
public function _setFieldMappings(array $mappings): void
97102
{
@@ -100,7 +105,8 @@ public function _setFieldMappings(array $mappings): void
100105

101106
/**
102107
* @internal
103-
* @return list<\KDuma\SimpleDAL\Typed\FieldMapping>
108+
*
109+
* @return list<FieldMapping>
104110
*/
105111
public function _getFieldMappings(): array
106112
{

src/plugins/typed/library/src/Entity/TypedCollectionDefinition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace KDuma\SimpleDAL\Typed\Entity;
66

77
use KDuma\SimpleDAL\Contracts\EntityDefinitionInterface;
8+
use KDuma\SimpleDAL\Typed\Contracts\TypedRecord;
89

910
class TypedCollectionDefinition implements EntityDefinitionInterface
1011
{
@@ -14,7 +15,7 @@ class TypedCollectionDefinition implements EntityDefinitionInterface
1415

1516
/**
1617
* @param string $name Entity name.
17-
* @param class-string<\KDuma\SimpleDAL\Typed\Contracts\TypedRecord>|null $recordClass TypedRecord subclass for hydration.
18+
* @param class-string<TypedRecord>|null $recordClass TypedRecord subclass for hydration.
1819
* @param class-string<\BackedEnum>|null $attachmentEnum Enum class for typed attachments.
1920
* @param bool $hasAttachments Whether the entity supports attachments.
2021
* @param bool $hasTimestamps Whether the entity tracks timestamps.

src/plugins/typed/library/src/Entity/TypedSingletonDefinition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace KDuma\SimpleDAL\Typed\Entity;
66

77
use KDuma\SimpleDAL\Contracts\EntityDefinitionInterface;
8+
use KDuma\SimpleDAL\Typed\Contracts\TypedRecord;
89

910
class TypedSingletonDefinition implements EntityDefinitionInterface
1011
{
@@ -19,7 +20,7 @@ class TypedSingletonDefinition implements EntityDefinitionInterface
1920

2021
/**
2122
* @param string $name Entity name.
22-
* @param class-string<\KDuma\SimpleDAL\Typed\Contracts\TypedRecord>|null $recordClass TypedRecord subclass for hydration.
23+
* @param class-string<TypedRecord>|null $recordClass TypedRecord subclass for hydration.
2324
* @param class-string<\BackedEnum>|null $attachmentEnum Enum class for typed attachments.
2425
* @param bool $hasAttachments Whether the entity supports attachments.
2526
* @param bool $hasTimestamps Whether the entity tracks timestamps.

src/plugins/typed/library/src/TypedRecordHydrator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function discoverFields(string $class): array
5151
if ($field->converter !== null) {
5252
/** @var class-string<FieldConverterInterface> $converterClass */
5353
$converterClass = $field->converter;
54-
$converter = new $converterClass();
54+
$converter = new $converterClass;
5555
} else {
5656
// Auto-detect backed enum
5757
$type = $prop->getType();

src/plugins/typed/library/tests/TypedDataStoreIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class SettingsRecord extends TypedRecord
9595
// -----------------------------------------------------------------
9696

9797
/**
98-
* @param array<string> $tags
98+
* @param array<string> $tags
9999
*/
100100
function makeArticle(TypedDataStore $store, string $title = 'Test', IntegrationStatus $status = IntegrationStatus::Draft, ?string $body = null, ?DateTimeImmutable $publishedAt = null, array $tags = []): ArticleRecord
101101
{

0 commit comments

Comments
 (0)