Skip to content

Commit 379961f

Browse files
wip
1 parent 90d8be5 commit 379961f

14 files changed

+37
-75
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v5
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
24+
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v6
27+
with:
28+
commit_message: Fix styling

.github/workflows/php-cs-fixer.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.php-cs-fixer.dist.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
"illuminate/database": "^11.0|^12.0",
3030
"illuminate/support": "^11.0|^12.0",
3131
"illuminate/validation": "^11.0|^12.0",
32-
"laravel/framework": "11.*",
33-
"orchestra/testbench": "9.*",
3432
"spatie/laravel-package-tools": "^1.14.1"
3533
},
3634
"require-dev": {
37-
"friendsofphp/php-cs-fixer": "^3.4",
35+
"laravel/pint": "^1.25",
36+
"orchestra/testbench": "^9.0|^10.0",
3837
"pestphp/pest": "^3.8",
3938
"pestphp/pest-plugin-laravel": "^3.2",
4039
"phpunit/phpunit": "^10.5|^11.0",
@@ -51,7 +50,7 @@
5150
}
5251
},
5352
"scripts": {
54-
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
53+
"format": "vendor/bin/pint",
5554
"psalm": "vendor/bin/psalm",
5655
"test": "vendor/bin/pest",
5756
"test-coverage": "vendor/bin/pest --coverage"

src/Encrypter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function getEncryptionKey(): string
1818
$key = config('encryptable.key');
1919

2020
if (empty($key)) {
21-
throw new MissingEncryptionKeyException();
21+
throw new MissingEncryptionKeyException;
2222
}
2323

2424
return (string) $key;
@@ -29,7 +29,7 @@ protected function getEncryptionCipher(): string
2929
$cipher = config('encryptable.cipher');
3030

3131
if (empty($cipher)) {
32-
throw new MissingEncryptionCipherException();
32+
throw new MissingEncryptionCipherException;
3333
}
3434

3535
return (string) $cipher;

src/Utils/Serializer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static function serialize($value): string
1919
$valueType = gettype($value);
2020

2121
if (! in_array($valueType, self::SUPPORTED_TYPES)) {
22-
throw new SerializationException();
22+
throw new SerializationException;
2323
}
2424

2525
$value = strval($value);
@@ -32,13 +32,13 @@ public static function unserialize(string $payload)
3232
$payload = explode(':', $payload, 2);
3333

3434
if (count($payload) !== 2) {
35-
throw new UnserializationException();
35+
throw new UnserializationException;
3636
}
3737

3838
[$valueType, $value] = $payload;
3939

4040
if (! settype($value, $valueType)) {
41-
throw new UnserializationException();
41+
throw new UnserializationException;
4242
}
4343

4444
return $value;

tests/DBEncrypterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use Illuminate\Contracts\Encryption\EncryptException;
44
use Maize\Encryptable\Encryption;
55

6-
76
it('should throw exception on db encrypt', function () {
87
$this->expectException(EncryptException::class);
98

tests/EncryptableTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Maize\Encryptable\Encryption;
55
use Maize\Encryptable\Tests\Models\User;
66

7-
87
it('should encrypt data when saving model instance', function () {
98
$user = $this->createUser();
109

tests/EncrypterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Maize\Encryptable\Exceptions\MissingEncryptionCipherException;
55
use Maize\Encryptable\Exceptions\MissingEncryptionKeyException;
66

7-
87
it('should throw exception when encryption key is missing', function () {
98
config()->set('encryptable.key', null);
109

tests/ExistsEncryptedTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Illuminate\Validation\Rule;
55
use Maize\Encryptable\Rules\ExistsEncrypted;
66

7-
87
it('should validate encrypted data with custom exists rule', function () {
98
$user = $this->createUser();
109

0 commit comments

Comments
 (0)