Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

- name: Test code style pint
run: composer run pint-test

- name: Test with phpunit
run: composer run tests:coverage
env:
Expand Down
1 change: 0 additions & 1 deletion app/App/Shared/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Handler extends ExceptionHandler
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
});
}
}
1 change: 0 additions & 1 deletion app/App/Shared/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ class EncryptCookies extends Middleware
* @var array<int, string>
*/
protected $except = [
//
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ class PreventRequestsDuringMaintenance extends Middleware
* @var array<int, string>
*/
protected $except = [
//
];
}
2 changes: 1 addition & 1 deletion app/App/Shared/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
* @param Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
Expand Down
1 change: 0 additions & 1 deletion app/App/Shared/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ class VerifyCsrfToken extends Middleware
* @var array<int, string>
*/
protected $except = [
//
];
}
2 changes: 0 additions & 2 deletions app/App/Shared/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}

public function boot(): void
{
//
}
}
2 changes: 0 additions & 2 deletions app/App/Shared/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ class AuthServiceProvider extends ServiceProvider
* @var array<class-string, class-string>
*/
protected $policies = [
//
];

public function boot(): void
{
//
}
}
1 change: 0 additions & 1 deletion app/App/Shared/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot(): void
{
//
}

/**
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/pint": "^1.13",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
Expand All @@ -36,6 +36,10 @@
"scripts": {
"tests": "vendor/bin/phpunit",
"tests:coverage": "vendor/bin/phpunit --coverage-clover coverage.xml",
"pint": "./vendor/bin/pint",
"pint-dirty": "./vendor/bin/pint --dirty",
"pint-test": "./vendor/bin/pint --test",
"pint-test-dirty": "./vendor/bin/pint --test --dirty",
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('password_reset_tokens', function (Blueprint $table) {
Expand Down
21 changes: 21 additions & 0 deletions docs/technical/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,24 @@ If you want to execute scripts or run commands, you need to open up a shell proc
```shell
docker compose exec php sh
```


## Code style

We've implemented a code style checker and fixer called Laravel Pint, which is a wrapper around PHP-CS-Fixer.

The following composer scripts can be run:

```shell
# To fix the codebase code style
composer run pint

# Fix code style on the changes you made
composer run pint-dirty

# Test the code style of the codebase
composer run pint-test

# Test the code style of the changes you made
composer run pint-test-dirty
```
52 changes: 52 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"preset": "laravel",
"exclude": [
"config",
"lang"
],
"rules": {
"no_extra_blank_lines": {
"tokens": [
"attribute",
"break",
"case",
"continue",
"curly_brace_block",
"default",
"extra",
"parenthesis_brace_block",
"return",
"square_brace_block",
"switch",
"throw",
"use",
"use_trait"
]
},
"method_argument_space": {
"on_multiline": "ensure_fully_multiline"
},
"align_multiline_comment": true,
"class_definition": {
"single_line": false
},
"new_with_braces": {
"anonymous_class": false,
"named_class": true
},
"global_namespace_import": {
"import_classes": true,
"import_constants": true,
"import_functions": false
},
"is_null": true,
"logical_operators": true,
"no_empty_comment": true,
"ordered_traits": true,
"ternary_to_null_coalescing": true,
"explicit_indirect_variable": true,
"modernize_types_casting": true,
"no_useless_else": true,
"nullable_type_declaration_for_default_null_value": true
}
}