Skip to content

Commit 8c5642d

Browse files
authored
Change php-cs-fixer to laravel pint (#219)
1 parent 7663028 commit 8c5642d

File tree

235 files changed

+836
-2973
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+836
-2973
lines changed

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

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

.github/workflows/pint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Laravel Pint
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
pint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- name: Install Dependencies
12+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist --working-dir=tools/pint
13+
14+
- name: Laravel Pint Dry Run
15+
run: ./tools/pint/vendor/bin/pint -v --test

.php-cs-fixer.dist.php

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

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
composer-install-tools:
2-
composer install --working-dir=tools/php-cs-fixer
2+
composer install --working-dir=tools/pint
33
composer install --working-dir=tools/phpstan
4-
php-cs-version:
5-
./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --version
6-
php-cs-dry:
7-
./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose --dry-run
8-
php-cs-dry-diff:
9-
./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose --diff --dry-run
10-
php-cs-fix:
11-
./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose
12-
phpstan:
4+
pint:
5+
./tools/pint/vendor/bin/pint -v
6+
stan:
137
./tools/phpstan/vendor/bin/phpstan analyse -c phpstan.neon
148
test:
159
./vendor/bin/phpunit

pint.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"preset": "laravel",
3+
"exclude": [
4+
"tests/Console/DacapoCommandTest"
5+
],
6+
"rules": {
7+
"concat_space": false,
8+
"date_time_immutable": true,
9+
"declare_parentheses": true,
10+
"declare_strict_types": true,
11+
"final_class": true,
12+
"global_namespace_import": {
13+
"import_classes": true,
14+
"import_constants": true,
15+
"import_functions": true
16+
},
17+
"mb_str_functions": true,
18+
"no_superfluous_phpdoc_tags": true,
19+
"not_operator_with_successor_space": true,
20+
"phpdoc_align": {
21+
"align": "left"
22+
},
23+
"phpdoc_separation": false,
24+
"php_unit_test_case_static_method_calls": {
25+
"call_type": "this"
26+
},
27+
"simplified_if_return": true,
28+
"simplified_null_return": true
29+
}
30+
}

src/Dacapo/Application/UseCase/DacapoCommandUseCase.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace UcanLab\LaravelDacapo\Dacapo\Application\UseCase;
46

@@ -13,13 +15,6 @@
1315

1416
final class DacapoCommandUseCase
1517
{
16-
/**
17-
* @param DatabaseSchemasStorage $databaseSchemasStorage
18-
* @param DatabaseMigrationsStorage $databaseMigrationsStorage
19-
* @param DatabaseDriver $databaseBuilder
20-
* @param MigrationCreateStub $migrationCreateStub
21-
* @param MigrationUpdateStub $migrationUpdateStub
22-
*/
2318
public function __construct(
2419
private DatabaseSchemasStorage $databaseSchemasStorage,
2520
private DatabaseMigrationsStorage $databaseMigrationsStorage,
@@ -29,9 +24,6 @@ public function __construct(
2924
) {
3025
}
3126

32-
/**
33-
* @return DacapoCommandUseCaseOutput
34-
*/
3527
public function handle(): DacapoCommandUseCaseOutput
3628
{
3729
$schemaList = $this->databaseSchemasStorage->getSchemaList();
@@ -46,7 +38,6 @@ public function handle(): DacapoCommandUseCaseOutput
4638
}
4739

4840
/**
49-
* @param SchemaList $schemaList
5041
* @return array<int, string>
5142
*/
5243
private function generateCreateTableMigrationFile(SchemaList $schemaList): array
@@ -64,7 +55,6 @@ private function generateCreateTableMigrationFile(SchemaList $schemaList): array
6455
}
6556

6657
/**
67-
* @param SchemaList $schemaList
6858
* @return array<int, string>
6959
*/
7060
private function generateCreateIndexMigrationFile(SchemaList $schemaList): array
@@ -84,7 +74,6 @@ private function generateCreateIndexMigrationFile(SchemaList $schemaList): array
8474
}
8575

8676
/**
87-
* @param SchemaList $schemaList
8877
* @return array<int, string>
8978
*/
9079
private function generateConstraintForeignKeyMigrationFile(SchemaList $schemaList): array

src/Dacapo/Application/UseCase/Input/DacapoCommandUseCaseInput.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace UcanLab\LaravelDacapo\Dacapo\Application\UseCase\Input;
46

src/Dacapo/Application/UseCase/Output/DacapoCommandUseCaseOutput.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace UcanLab\LaravelDacapo\Dacapo\Application\UseCase\Output;
46

src/Dacapo/Console/DacapoClearCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace UcanLab\LaravelDacapo\Dacapo\Console;
46

@@ -30,9 +32,6 @@ final class DacapoClearCommand extends Command
3032
*/
3133
protected $description = 'Clear migration directory.';
3234

33-
/**
34-
* @param Filesystem $filesystem
35-
*/
3635
public function handle(Filesystem $filesystem): void
3736
{
3837
$this->newLine();

src/Dacapo/Console/DacapoCommand.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace UcanLab\LaravelDacapo\Dacapo\Console;
46

@@ -32,16 +34,13 @@ final class DacapoCommand extends Command
3234
*/
3335
protected $description = 'Generate migrations from schemas and migrate:fresh command.';
3436

35-
/**
36-
* @param DacapoCommandUseCase $useCase
37-
*/
3837
public function handle(
3938
DacapoCommandUseCase $useCase,
4039
): void {
4140
$this->call('dacapo:clear', ['--force' => true]);
4241

4342
$this->newLine();
44-
$this->components->info( 'Generating migration files.');
43+
$this->components->info('Generating migration files.');
4544

4645
$output = $useCase->handle();
4746

0 commit comments

Comments
 (0)