From 1ed2c105e2d1f7c012719d75d00b3d1b2f5d63be Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 08:13:41 +0000 Subject: [PATCH] Add pint style checking to GitHub Actions workflows Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com> --- .github/workflows/release-test.yml | 2 + .github/workflows/test.yml | 2 + app/Console/Kernel.php | 1 - bootstrap/app.php | 15 ++-- bootstrap/providers.php | 7 +- config/app.php | 71 ++++++++++------ config/auth.php | 7 +- config/datatables.php | 13 ++- config/debugbar.php | 82 +++++++++---------- config/log-viewer.php | 8 +- config/logging.php | 3 +- config/translatable.php | 4 +- config/translation-loader.php | 10 ++- index.php | 2 +- .../admin/database/factories/MediaFactory.php | 4 +- .../admin/database/factories/UserFactory.php | 5 +- modules/admin/src/Enums/UserStatus.php | 3 +- .../Http/Controllers/DashboardController.php | 3 +- modules/admin/src/Models/Guest.php | 3 +- modules/admin/src/Models/User.php | 2 +- .../src/Providers/AdminServiceProvider.php | 8 +- public/index.php | 2 +- resources/lang/ca/passwords.php | 2 +- resources/lang/da/passwords.php | 2 +- resources/lang/el/passwords.php | 2 +- tests/CreatesApplication.php | 2 +- 26 files changed, 161 insertions(+), 104 deletions(-) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 81d55d4f..9ea6a1ff 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -48,3 +48,5 @@ jobs: DB_CONNECTION: sqlite DB_DATABASE: database/database.sqlite run: php artisan test + - name: Execute pint + run: vendor/bin/pint --test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4cc75414..761287f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,3 +45,5 @@ jobs: DB_CONNECTION: sqlite DB_DATABASE: database/database.sqlite run: php artisan test + - name: Execute pint + run: vendor/bin/pint --test diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b386f56a..bd731ec1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -10,7 +10,6 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) diff --git a/bootstrap/app.php b/bootstrap/app.php index 71eb34b6..e3cfe87d 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,22 +3,27 @@ use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; use Juzaweb\Modules\Core\Application; +use Juzaweb\Modules\Core\Http\Middleware\Authenticate; +use Juzaweb\Modules\Core\Http\Middleware\Captcha; +use Juzaweb\Modules\Core\Http\Middleware\EnsureEmailIsVerified; +use Juzaweb\Modules\Core\Http\Middleware\ForceSchemeUrl; +use Juzaweb\Modules\Core\Http\Middleware\ValidateSignature; return Application::configure(basePath: dirname(__DIR__)) ->withMiddleware( function (Middleware $middleware) { $middleware->alias([ - 'auth' => \Juzaweb\Modules\Core\Http\Middleware\Authenticate::class, - 'verified' => \Juzaweb\Modules\Core\Http\Middleware\EnsureEmailIsVerified::class, - 'captcha' => \Juzaweb\Modules\Core\Http\Middleware\Captcha::class, - 'signed' => \Juzaweb\Modules\Core\Http\Middleware\ValidateSignature::class, + 'auth' => Authenticate::class, + 'verified' => EnsureEmailIsVerified::class, + 'captcha' => Captcha::class, + 'signed' => ValidateSignature::class, ]); if (! env('VERIFY_TOKEN', true)) { $middleware->validateCsrfTokens(except: ['*']); } - $middleware->append(\Juzaweb\Modules\Core\Http\Middleware\ForceSchemeUrl::class); + $middleware->append(ForceSchemeUrl::class); } ) ->withExceptions(function (Exceptions $exceptions) { diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 8076e7f0..81314a32 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -1,6 +1,9 @@ env('APP_URL', 'http://localhost'), - 'mix_url' => env('MIX_ASSET_URL'), /* @@ -146,32 +169,32 @@ /* * Laravel Framework Service Providers... */ - Illuminate\Auth\AuthServiceProvider::class, - Illuminate\Broadcasting\BroadcastServiceProvider::class, - Illuminate\Bus\BusServiceProvider::class, - Illuminate\Cache\CacheServiceProvider::class, - Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, - Illuminate\Cookie\CookieServiceProvider::class, - Illuminate\Database\DatabaseServiceProvider::class, - Illuminate\Encryption\EncryptionServiceProvider::class, - Illuminate\Filesystem\FilesystemServiceProvider::class, - Illuminate\Foundation\Providers\FoundationServiceProvider::class, - Illuminate\Hashing\HashServiceProvider::class, - Illuminate\Mail\MailServiceProvider::class, - Illuminate\Notifications\NotificationServiceProvider::class, - Illuminate\Pagination\PaginationServiceProvider::class, - Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, - Illuminate\Redis\RedisServiceProvider::class, - Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, - Illuminate\Session\SessionServiceProvider::class, - \Spatie\TranslationLoader\TranslationServiceProvider::class, - Illuminate\Validation\ValidationServiceProvider::class, - Illuminate\View\ViewServiceProvider::class, + AuthServiceProvider::class, + BroadcastServiceProvider::class, + BusServiceProvider::class, + CacheServiceProvider::class, + ConsoleSupportServiceProvider::class, + CookieServiceProvider::class, + DatabaseServiceProvider::class, + EncryptionServiceProvider::class, + FilesystemServiceProvider::class, + FoundationServiceProvider::class, + HashServiceProvider::class, + MailServiceProvider::class, + NotificationServiceProvider::class, + PaginationServiceProvider::class, + PipelineServiceProvider::class, + QueueServiceProvider::class, + RedisServiceProvider::class, + PasswordResetServiceProvider::class, + SessionServiceProvider::class, + TranslationServiceProvider::class, + ValidationServiceProvider::class, + ViewServiceProvider::class, // App Service Providers ], - 'aliases' => \Illuminate\Support\Facades\Facade::defaultAliases()->merge( + 'aliases' => Facade::defaultAliases()->merge( [ // ] diff --git a/config/auth.php b/config/auth.php index 064dc910..884a5da4 100644 --- a/config/auth.php +++ b/config/auth.php @@ -1,5 +1,8 @@ [ 'users' => [ 'driver' => 'eloquent', - 'model' => env('AUTH_MODEL', \Juzaweb\Modules\Admin\Models\User::class), - 'social_connection_model' => \Juzaweb\Modules\Core\Models\UserSocialConnection::class, + 'model' => env('AUTH_MODEL', User::class), + 'social_connection_model' => UserSocialConnection::class, ], ], diff --git a/config/datatables.php b/config/datatables.php index bdb963fe..c5acda66 100644 --- a/config/datatables.php +++ b/config/datatables.php @@ -1,5 +1,10 @@ [ - 'eloquent' => Yajra\DataTables\EloquentDataTable::class, - 'query' => Yajra\DataTables\QueryDataTable::class, - 'collection' => Yajra\DataTables\CollectionDataTable::class, - 'resource' => Yajra\DataTables\ApiResourceDataTable::class, + 'eloquent' => EloquentDataTable::class, + 'query' => QueryDataTable::class, + 'collection' => CollectionDataTable::class, + 'resource' => ApiResourceDataTable::class, ], /* diff --git a/config/debugbar.php b/config/debugbar.php index 03a094ad..e0036abc 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -37,14 +37,14 @@ | Leaving it to null will allow localhost only. */ 'storage' => [ - 'enabled' => true, - 'open' => env('DEBUGBAR_OPEN_STORAGE'), // bool/callback. - 'driver' => 'file', // redis, file, pdo, socket, custom - 'path' => storage_path('debugbar'), // For file driver + 'enabled' => true, + 'open' => env('DEBUGBAR_OPEN_STORAGE'), // bool/callback. + 'driver' => 'file', // redis, file, pdo, socket, custom + 'path' => storage_path('debugbar'), // For file driver 'connection' => null, // Leave null for default connection (Redis/PDO) - 'provider' => '', // Instance of StorageInterface for custom driver - 'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver - 'port' => 2304, // Port to use with the "socket" driver + 'provider' => '', // Instance of StorageInterface for custom driver + 'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver + 'port' => 2304, // Port to use with the "socket" driver ], /* @@ -159,30 +159,30 @@ */ 'collectors' => [ - 'phpinfo' => true, // Php version - 'messages' => true, // Messages - 'time' => true, // Time Datalogger - 'memory' => true, // Memory usage - 'exceptions' => true, // Exception displayer - 'log' => true, // Logs from Monolog (merged in messages if enabled) - 'db' => true, // Show database (PDO) queries and bindings - 'views' => true, // Views with their data - 'route' => true, // Current route information - 'auth' => false, // Display Laravel authentication status - 'gate' => true, // Display Laravel Gate checks - 'session' => true, // Display session data + 'phpinfo' => true, // Php version + 'messages' => true, // Messages + 'time' => true, // Time Datalogger + 'memory' => true, // Memory usage + 'exceptions' => true, // Exception displayer + 'log' => true, // Logs from Monolog (merged in messages if enabled) + 'db' => true, // Show database (PDO) queries and bindings + 'views' => true, // Views with their data + 'route' => true, // Current route information + 'auth' => false, // Display Laravel authentication status + 'gate' => true, // Display Laravel Gate checks + 'session' => true, // Display session data 'symfony_request' => true, // Only one can be enabled.. - 'mail' => true, // Catch mail messages - 'laravel' => false, // Laravel version and environment - 'events' => false, // All events fired + 'mail' => true, // Catch mail messages + 'laravel' => false, // Laravel version and environment + 'events' => false, // All events fired 'default_request' => false, // Regular or special Symfony request logger - 'logs' => false, // Add the latest log messages - 'files' => false, // Show the included files - 'config' => false, // Display config settings - 'cache' => false, // Display cache events - 'models' => true, // Display models - 'livewire' => true, // Display Livewire (when available) - 'jobs' => false, // Display dispatched jobs + 'logs' => false, // Add the latest log messages + 'files' => false, // Show the included files + 'config' => false, // Display config settings + 'cache' => false, // Display cache events + 'models' => true, // Display models + 'livewire' => true, // Display Livewire (when available) + 'jobs' => false, // Display dispatched jobs ], /* @@ -211,21 +211,21 @@ 'show_guards' => true, // Show the guards that are used ], 'db' => [ - 'with_params' => true, // Render SQL with the parameters substituted - 'backtrace' => true, // Use a backtrace to find the origin of the query in your files. + 'with_params' => true, // Render SQL with the parameters substituted + 'backtrace' => true, // Use a backtrace to find the origin of the query in your files. 'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults) - 'timeline' => false, // Add the queries to the timeline - 'duration_background' => true, // Show shaded background on each query relative to how long it took to execute. + 'timeline' => false, // Add the queries to the timeline + 'duration_background' => true, // Show shaded background on each query relative to how long it took to execute. 'explain' => [ // Show EXPLAIN output on queries 'enabled' => false, 'types' => ['SELECT'], // Deprecated setting, is always only SELECT ], - 'hints' => false, // Show hints for common mistakes - 'show_copy' => false, // Show copy button next to the query, - 'slow_threshold' => false, // Only track queries that last longer than this time in ms - 'memory_usage' => false, // Show queries memory usage - 'soft_limit' => 100, // After the soft limit, no parameters/backtrace are captured - 'hard_limit' => 500, // After the hard limit, queries are ignored + 'hints' => false, // Show hints for common mistakes + 'show_copy' => false, // Show copy button next to the query, + 'slow_threshold' => false, // Only track queries that last longer than this time in ms + 'memory_usage' => false, // Show queries memory usage + 'soft_limit' => 100, // After the soft limit, no parameters/backtrace are captured + 'hard_limit' => 500, // After the hard limit, queries are ignored ], 'mail' => [ 'timeline' => false, // Add mails to the timeline @@ -233,10 +233,10 @@ ], 'views' => [ 'timeline' => false, // Add the views to the timeline (Experimental) - 'data' => false, //true for all data, 'keys' for only names, false for no parameters. + 'data' => false, // true for all data, 'keys' for only names, false for no parameters. 'group' => 50, // Group duplicate views. Pass value to auto-group, or true/false to force 'exclude_paths' => [ // Add the paths which you don't want to appear in the views - 'vendor/filament' // Exclude Filament components by default + 'vendor/filament', // Exclude Filament components by default ], ], 'route' => [ diff --git a/config/log-viewer.php b/config/log-viewer.php index 1f0dc74d..7a98f04b 100644 --- a/config/log-viewer.php +++ b/config/log-viewer.php @@ -3,6 +3,8 @@ use Opcodes\LogViewer\Enums\SortingMethod; use Opcodes\LogViewer\Enums\SortingOrder; use Opcodes\LogViewer\Enums\Theme; +use Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer; +use Opcodes\LogViewer\Http\Middleware\EnsureFrontendRequestsAreStateful; return [ @@ -97,7 +99,7 @@ 'middleware' => [ 'web', - \Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class, + AuthorizeLogViewer::class, ], /* @@ -110,8 +112,8 @@ */ 'api_middleware' => [ - \Opcodes\LogViewer\Http\Middleware\EnsureFrontendRequestsAreStateful::class, - \Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class, + EnsureFrontendRequestsAreStateful::class, + AuthorizeLogViewer::class, ], 'api_stateful_domains' => env('LOG_VIEWER_API_STATEFUL_DOMAINS') ? explode(',', env('LOG_VIEWER_API_STATEFUL_DOMAINS')) : null, diff --git a/config/logging.php b/config/logging.php index b5a77ee1..2169753a 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,6 @@ env('LOG_LEVEL', 'debug'), 'days' => env('LOG_DAILY_DAYS', 14), 'replace_placeholders' => true, - 'tap' => [\Juzaweb\Modules\Core\Logging\AddCustomInformation::class], + 'tap' => [AddCustomInformation::class], ], 'subscription' => [ diff --git a/config/translatable.php b/config/translatable.php index 5202aae1..cfe8613b 100644 --- a/config/translatable.php +++ b/config/translatable.php @@ -1,5 +1,7 @@ [ - 'format' => \Astrotomic\Translatable\Validation\RuleFactory::FORMAT_ARRAY, + 'format' => RuleFactory::FORMAT_ARRAY, 'prefix' => '%', 'suffix' => '%', ], diff --git a/config/translation-loader.php b/config/translation-loader.php index 9e427c5b..5e95d4a5 100644 --- a/config/translation-loader.php +++ b/config/translation-loader.php @@ -1,5 +1,9 @@ [ - Spatie\TranslationLoader\TranslationLoaders\Db::class, + Db::class, ], /* * This is the model used by the Db Translation loader. You can put any model here * that extends Spatie\TranslationLoader\LanguageLine. */ - 'model' => \Juzaweb\Modules\Core\Translations\Models\LanguageLine::class, + 'model' => LanguageLine::class, /* * This is the translation manager which overrides the default Laravel `translation.loader` */ - 'translation_manager' => Spatie\TranslationLoader\TranslationLoaderManager::class, + 'translation_manager' => TranslationLoaderManager::class, ]; diff --git a/index.php b/index.php index 353c1fda..099367af 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ define('LARAVEL_START', microtime(true)); -const JW_BASE_PATH = __DIR__ . '/..'; +const JW_BASE_PATH = __DIR__.'/..'; // Determine if the application is in maintenance mode... if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { diff --git a/modules/admin/database/factories/MediaFactory.php b/modules/admin/database/factories/MediaFactory.php index e26dbde2..1bee493c 100644 --- a/modules/admin/database/factories/MediaFactory.php +++ b/modules/admin/database/factories/MediaFactory.php @@ -20,11 +20,11 @@ class MediaFactory extends Factory */ public function definition(): array { - $filename = $this->faker->uuid() . '.jpg'; + $filename = $this->faker->uuid().'.jpg'; return [ 'name' => $filename, - 'path' => 'tests/' . $filename, + 'path' => 'tests/'.$filename, 'mime_type' => 'image/jpeg', 'size' => 102400, // 100KB 'type' => 'file', diff --git a/modules/admin/database/factories/UserFactory.php b/modules/admin/database/factories/UserFactory.php index a828f91b..8e33618a 100644 --- a/modules/admin/database/factories/UserFactory.php +++ b/modules/admin/database/factories/UserFactory.php @@ -3,19 +3,20 @@ namespace Juzaweb\Modules\Admin\Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; use Juzaweb\Modules\Admin\Models\User; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\Juzaweb\Modules\Admin\Models\User> + * @extends Factory */ class UserFactory extends Factory { /** * The name of the factory's corresponding model. * - * @var class-string<\Illuminate\Database\Eloquent\Model> + * @var class-string */ protected $model = User::class; diff --git a/modules/admin/src/Enums/UserStatus.php b/modules/admin/src/Enums/UserStatus.php index 635a2c7c..364d3945 100644 --- a/modules/admin/src/Enums/UserStatus.php +++ b/modules/admin/src/Enums/UserStatus.php @@ -1,9 +1,10 @@ publishes([ - $sourcePath => $viewPath + $sourcePath => $viewPath, ], ['views', 'admin-module-views']); $this->loadViewsFrom($sourcePath, 'admin'); diff --git a/public/index.php b/public/index.php index 4acfab2e..eab8e692 100644 --- a/public/index.php +++ b/public/index.php @@ -4,7 +4,7 @@ define('LARAVEL_START', microtime(true)); -const JW_BASE_PATH = __DIR__ . '/..'; +const JW_BASE_PATH = __DIR__.'/..'; // Determine if the application is in maintenance mode... if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { diff --git a/resources/lang/ca/passwords.php b/resources/lang/ca/passwords.php index c87d0720..2c8de7b6 100644 --- a/resources/lang/ca/passwords.php +++ b/resources/lang/ca/passwords.php @@ -5,5 +5,5 @@ 'sent' => 'Us hem enviat l\'enllaç de restabliment de contrasenya per correu electrònic!', 'throttled' => 'Si us plau, espereu abans de tornar-ho a provar.', 'token' => 'Aquest testimoni de restabliment de contrasenya no és vàlid.', - 'user' => "No podem trobar cap usuari amb aquesta adreça de correu electrònic.", + 'user' => 'No podem trobar cap usuari amb aquesta adreça de correu electrònic.', ]; diff --git a/resources/lang/da/passwords.php b/resources/lang/da/passwords.php index 4b57615f..88d9ea84 100644 --- a/resources/lang/da/passwords.php +++ b/resources/lang/da/passwords.php @@ -5,5 +5,5 @@ 'sent' => 'Vi har sendt dig et link til nulstilling af adgangskode!', 'throttled' => 'Vent venligst før du prøver igen.', 'token' => 'Denne nulstillingstoken til adgangskode er ugyldig.', - 'user' => "Vi kan ikke finde en bruger med den e-mailadresse.", + 'user' => 'Vi kan ikke finde en bruger med den e-mailadresse.', ]; diff --git a/resources/lang/el/passwords.php b/resources/lang/el/passwords.php index 786b8089..936eb72f 100644 --- a/resources/lang/el/passwords.php +++ b/resources/lang/el/passwords.php @@ -5,5 +5,5 @@ 'sent' => 'Σας στείλαμε με email τον σύνδεσμο επαναφοράς κωδικού πρόσβασης!', 'throttled' => 'Παρακαλούμε περιμένετε πριν προσπαθήσετε ξανά.', 'token' => 'Αυτό το διακριτικό επαναφοράς κωδικού πρόσβασης δεν είναι έγκυρο.', - 'user' => "Δεν μπορούμε να βρούμε χρήστη με αυτή τη διεύθυνση email.", + 'user' => 'Δεν μπορούμε να βρούμε χρήστη με αυτή τη διεύθυνση email.', ]; diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index e3ad27ec..cc683011 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -12,7 +12,7 @@ trait CreatesApplication */ public function createApplication(): Application { - $app = require __DIR__ . '/../bootstrap/app.php'; + $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap();