Skip to content

Commit

Permalink
Added php-cs-fixer rule void_return
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Sep 18, 2024
1 parent 590fed6 commit bfd70f2
Show file tree
Hide file tree
Showing 51 changed files with 96 additions and 95 deletions.
2 changes: 1 addition & 1 deletion app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function create(array $input): User
}
$user = null;
$organization = null;
DB::transaction(function () use (&$user, &$organization, $input, $timezone, $startOfWeek, $currency) {
DB::transaction(function () use (&$user, &$organization, $input, $timezone, $startOfWeek, $currency): void {
$user = User::create([
'name' => $input['name'],
'email' => $input['email'],
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Jetstream/AddOrganizationMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function add(User $owner, Organization $organization, string $email, ?str

AddingTeamMember::dispatch($organization, $newOrganizationMember);

DB::transaction(function () use ($organization, $newOrganizationMember, $role) {
DB::transaction(function () use ($organization, $newOrganizationMember, $role): void {
$organization->users()->attach(
$newOrganizationMember, ['role' => $role]
);
Expand Down Expand Up @@ -93,7 +93,7 @@ protected function rules(): array
*/
protected function ensureUserIsNotAlreadyOnTeam(Organization $team, string $email): Closure
{
return function ($validator) use ($team, $email) {
return function ($validator) use ($team, $email): void {
$validator->errors()->addIf(
$team->hasRealUserWithEmail($email),
'email',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handle(): int
$query->where('is_placeholder', '=', false);
})
->orderBy('created_at', 'asc')
->chunk(500, function (Collection $timeEntries) use ($dryRun, &$sentMails) {
->chunk(500, function (Collection $timeEntries) use ($dryRun, &$sentMails): void {
/** @var Collection<int, TimeEntry> $timeEntries */
foreach ($timeEntries as $timeEntry) {
$user = $timeEntry->user;
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Handler extends ExceptionHandler
*/
public function register(): void
{
$this->reportable(function (Throwable $e) {
$this->reportable(function (Throwable $e): void {
//
});
}
Expand Down
4 changes: 2 additions & 2 deletions app/Filament/Resources/OrganizationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function table(Table $table): Table
->persistent()
->send();

return response()->streamDownload(function () use ($file) {
return response()->streamDownload(function () use ($file): void {

Check warning on line 125 in app/Filament/Resources/OrganizationResource.php

View check run for this annotation

Codecov / codecov/patch

app/Filament/Resources/OrganizationResource.php#L125

Added line #L125 was not covered by tests
echo Storage::disk(config('filesystems.private'))->get($file);
}, 'export.zip');
} catch (\Exception $exception) {
Expand All @@ -137,7 +137,7 @@ public static function table(Table $table): Table
}),
Action::make('Import')
->icon('heroicon-o-inbox-arrow-down')
->action(function (Organization $record, array $data) {
->action(function (Organization $record, array $data): void {
try {
$file = Storage::disk(config('filament.default_filesystem_disk'))->get($data['file']);
if ($file === null) {
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ public function boot(): void
});

// Scramble
Scramble::extendOpenApi(function (OpenApi $openApi) {
Scramble::extendOpenApi(function (OpenApi $openApi): void {
$openApi->secure(
SecurityScheme::oauth2()
->flow('authorizationCode', function (OAuthFlow $flow) {
->flow('authorizationCode', function (OAuthFlow $flow): void {

Check warning on line 87 in app/Providers/AppServiceProvider.php

View check run for this annotation

Codecov / codecov/patch

app/Providers/AppServiceProvider.php#L87

Added line #L87 was not covered by tests
$flow
->authorizationUrl('https://solidtime.test/oauth/authorize');
})
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function boot(): void
: Limit::perMinute(60)->by($request->ip());
});

$this->routes(function () {
$this->routes(function (): void {
Route::middleware('health-check')
->group(function () {
->group(function (): void {
Route::get('health-check/up', [HealthCheckController::class, 'up']);
Route::get('health-check/debug', [HealthCheckController::class, 'debug']);
});
Expand Down
6 changes: 3 additions & 3 deletions app/Service/BillableRateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function updateTimeEntriesBillableRateForProject(Project $project): void
->where('billable', '=', true)
->where('organization_id', '=', $project->organization_id)
->whereBelongsTo($project, 'project')
->whereDoesntHave('member', function (Builder $query) use ($project) {
->whereDoesntHave('member', function (Builder $query) use ($project): void {
/** @var Builder<Member> $query */
$query->whereHas('projectMembers', function (Builder $query) use ($project) {
$query->whereHas('projectMembers', function (Builder $query) use ($project): void {
/** @var Builder<ProjectMember> $query */
$query->whereBelongsTo($project, 'project')
->whereNotNull('billable_rate');
Expand Down Expand Up @@ -62,7 +62,7 @@ public function updateTimeEntriesBillableRateForOrganization(Organization $organ
TimeEntry::query()
->where('billable', '=', true)
->where('organization_id', '=', $organization->getKey())
->whereDoesntHave('member', function (Builder $builder) {
->whereDoesntHave('member', function (Builder $builder): void {
/** @var Builder<Member> $builder */
$builder->whereNotNull('billable_rate');
})
Expand Down
4 changes: 2 additions & 2 deletions app/Service/DeletionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(UserService $userService, MemberService $memberServi
public function deleteOrganization(Organization $organization, bool $inTransaction = true, ?User $ignoreUser = null): void
{
if ($inTransaction) {
DB::transaction(function () use ($organization) {
DB::transaction(function () use ($organization): void {
$this->deleteOrganization($organization, false);
});

Expand Down Expand Up @@ -123,7 +123,7 @@ public function deleteOrganization(Organization $organization, bool $inTransacti
public function deleteUser(User $user, bool $inTransaction = true): void
{
if ($inTransaction) {
DB::transaction(function () use ($user) {
DB::transaction(function () use ($user): void {
$this->deleteUser($user, false);
});

Expand Down
2 changes: 1 addition & 1 deletion app/Service/Import/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function import(Organization $organization, string $importerType, string
$lock = Cache::lock('import:'.$organization->getKey(), config('octane.max_execution_time', 60) + 1);

if ($lock->get()) {
DB::transaction(function () use (&$importer, &$data, &$timezone) {
DB::transaction(function () use (&$importer, &$data, &$timezone): void {
$importer->importData($data, $timezone);
});
$lock->release();
Expand Down
4 changes: 2 additions & 2 deletions app/Service/Import/Importers/DefaultImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function init(Organization $organization): void
'nullable',
'integer',
],
], beforeSave: function (Project $project) {
], beforeSave: function (Project $project): void {
if ($project->billable_rate === 0) {
$project->billable_rate = null;
}
Expand All @@ -126,7 +126,7 @@ public function init(Organization $organization): void
'nullable',
'integer',
],
], beforeSave: function (ProjectMember $projectMember) {
], beforeSave: function (ProjectMember $projectMember): void {
if ($projectMember->billable_rate === 0) {
$projectMember->billable_rate = null;
}
Expand Down
2 changes: 1 addition & 1 deletion database/factories/MemberFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function withBillableRate(): self

public function attachToOrganization(Organization $organization, array $pivot = []): static
{
return $this->afterCreating(function (User $user) use ($organization, $pivot) {
return $this->afterCreating(function (User $user) use ($organization, $pivot): void {
$user->organizations()->attach($organization, $pivot);
});
}
Expand Down
2 changes: 1 addition & 1 deletion database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function unverified(): static

public function attachToOrganization(Organization $organization, array $pivot = []): static
{
return $this->afterCreating(function (User $user) use ($organization, $pivot) {
return $this->afterCreating(function (User $user) use ($organization, $pivot): void {
$user->organizations()->attach($organization, $pivot);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
Schema::create('users', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('name');
$table->string('email');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('password_reset_tokens', function (Blueprint $table) {
Schema::create('password_reset_tokens', function (Blueprint $table): void {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
Schema::table('users', function (Blueprint $table): void {
$table->text('two_factor_secret')
->after('password')
->nullable();
Expand All @@ -36,7 +36,7 @@ public function up(): void
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
Schema::table('users', function (Blueprint $table): void {
$table->dropColumn(array_merge([
'two_factor_secret',
'two_factor_recovery_codes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('oauth_auth_codes', function (Blueprint $table) {
Schema::create('oauth_auth_codes', function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->foreignUuid('user_id')->index();
$table->uuid('client_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('oauth_access_tokens', function (Blueprint $table) {
Schema::create('oauth_access_tokens', function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->foreignUuid('user_id')->nullable()->index();
$table->uuid('client_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('oauth_refresh_tokens', function (Blueprint $table) {
Schema::create('oauth_refresh_tokens', function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('oauth_clients', function (Blueprint $table) {
Schema::create('oauth_clients', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('user_id')->nullable()->index();
$table->string('name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
Schema::create('oauth_personal_access_clients', function (Blueprint $table): void {
$table->bigIncrements('id');
$table->uuid('client_id');
$table->timestamps();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function up(): void
}
$schema = Schema::connection($this->getConnection());

$schema->create('telescope_entries', function (Blueprint $table) {
$schema->create('telescope_entries', function (Blueprint $table): void {
$table->bigIncrements('sequence');
$table->uuid('uuid');
$table->uuid('batch_id');
Expand All @@ -43,7 +43,7 @@ public function up(): void
$table->index(['type', 'should_display_on_index']);
});

$schema->create('telescope_entries_tags', function (Blueprint $table) {
$schema->create('telescope_entries_tags', function (Blueprint $table): void {
$table->uuid('entry_uuid');
$table->string('tag');

Expand All @@ -56,7 +56,7 @@ public function up(): void
->onDelete('cascade');
});

$schema->create('telescope_monitoring', function (Blueprint $table) {
$schema->create('telescope_monitoring', function (Blueprint $table): void {
$table->string('tag')->primary();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) {
Schema::create('failed_jobs', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->uuid('uuid')->unique();
$table->text('connection');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
Schema::create('personal_access_tokens', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->morphs('tokenable');
$table->string('name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('organizations', function (Blueprint $table) {
Schema::create('organizations', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('user_id')->index();
$table->string('name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('organization_user', function (Blueprint $table) {
Schema::create('organization_user', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('organization_id');
$table->foreignUuid('user_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('organization_invitations', function (Blueprint $table) {
Schema::create('organization_invitations', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->foreignUuid('organization_id')
->constrained()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('sessions', function (Blueprint $table) {
Schema::create('sessions', function (Blueprint $table): void {
$table->string('id')->primary();
$table->foreignUuid('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('clients', function (Blueprint $table) {
Schema::create('clients', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('name', 255);
$table->uuid('organization_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('projects', function (Blueprint $table) {
Schema::create('projects', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('name', 255);
$table->string('color', 16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('tasks', function (Blueprint $table) {
Schema::create('tasks', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('name', 500);
$table->uuid('project_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('tags', function (Blueprint $table) {
Schema::create('tags', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('name', 255);
$table->uuid('organization_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('time_entries', function (Blueprint $table) {
Schema::create('time_entries', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('description', 500);
$table->dateTime('start');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('project_members', function (Blueprint $table) {
Schema::create('project_members', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->integer('billable_rate')->unsigned()->nullable();
$table->uuid('project_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
Schema::create('jobs', function (Blueprint $table): void {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
Expand Down
Loading

0 comments on commit bfd70f2

Please sign in to comment.