Skip to content

Commit 2e7cb84

Browse files
committed
switch to pint
1 parent 4e29cb4 commit 2e7cb84

File tree

8 files changed

+30
-25
lines changed

8 files changed

+30
-25
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ jobs:
2727
run: composer install --prefer-dist --no-interaction --no-progress
2828

2929
- name: Code sniff
30-
run: vendor/bin/php-cs-fixer fix --dry-run
31-
env:
32-
PHP_CS_FIXER_IGNORE_ENV: true
30+
run: vendor/bin/pint --test
3331

3432
- name: Execute tests
3533
run: vendor/bin/phpunit

.php-cs-fixer.dist.php

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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"illuminate/support": "^10.0|^11.0|^12.0"
2020
},
2121
"require-dev": {
22-
"codinglabsau/php-styles": "dev-main",
2322
"phpunit/phpunit": "^10.0",
24-
"orchestra/testbench": "^8.0.1"
23+
"orchestra/testbench": "^8.0.1",
24+
"laravel/pint": "^1.25"
2525
},
2626
"autoload": {
2727
"psr-4": {

config/roles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
*/
1313

1414
'models' => [
15-
'role' => \Codinglabs\Roles\Role::class
16-
]
15+
'role' => \Codinglabs\Roles\Role::class,
16+
],
1717
];

pint.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"concat_space": {
5+
"spacing": "one"
6+
},
7+
"new_with_parentheses": {
8+
"named_class": true,
9+
"anonymous_class": true
10+
},
11+
"ordered_imports": {
12+
"imports_order": [
13+
"const",
14+
"class",
15+
"function"
16+
],
17+
"sort_algorithm": "length"
18+
}
19+
}
20+
}

src/CheckRole.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class CheckRole
1010
/**
1111
* Handle an incoming request.
1212
*
13-
* @param \Illuminate\Http\Request $request
14-
* @param \Closure $next
15-
* @param string $roles
13+
* @param \Illuminate\Http\Request $request
14+
* @param string $roles
1615
* @return mixed
1716
*/
1817
public function handle($request, Closure $next, $roles)

src/RolesServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function boot()
1515
], 'roles-config');
1616

1717
$this->publishes([
18-
__DIR__ . '/../database/migrations/' => database_path('migrations')
18+
__DIR__ . '/../database/migrations/' => database_path('migrations'),
1919
], 'roles-migrations');
2020

2121
Gate::define('role', function ($user, ...$roles) {

tests/TestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ protected function setUp(): void
4141
protected function getPackageProviders($app): array
4242
{
4343
return [
44-
RolesServiceProvider::class
44+
RolesServiceProvider::class,
4545
];
4646
}
4747

4848
/**
49-
* @param \Illuminate\Foundation\Application $app
50-
* @return void
49+
* @param \Illuminate\Foundation\Application $app
5150
*/
5251
protected function getEnvironmentSetUp($app): void
5352
{

0 commit comments

Comments
 (0)