Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentauger committed Dec 30, 2024
1 parent 749f629 commit 1efaf11
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthorEmploymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AuthorEmploymentController extends Controller
*/
public function index(Author $author)
{
//validate user can do this
// validate user can do this
$this->authorize('viewAny', [AuthorEmployment::class, $author]);

return AuthorEmploymentResource::collection($author->employments()->orderByDesc('start_date')->with('organization')->get());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ManuscriptAuthorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function update(Request $request, ManuscriptRecord $manuscriptRecord, Man
Gate::authorize('update', $manuscriptRecord);

$validated = $request->validate([
//'author_id' => 'integer|exists:authors,id',
// 'author_id' => 'integer|exists:authors,id',
'is_corresponding_author' => 'boolean',
'organization_id' => 'integer|exists:organizations,id',
]);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/PublicationAuthorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function update(Request $request, Publication $publication, PublicationAu
Gate::authorize('update', $publication);

$validated = $request->validate([
//'author_id' => 'integer|exists:authors,id',
// 'author_id' => 'integer|exists:authors,id',
'is_corresponding_author' => 'boolean',
'organization_id' => 'integer|exists:organizations,id',
]);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
//Removed for ManuscriptRecords empty string as valid value
// Removed for ManuscriptRecords empty string as valid value
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/ManuscriptRecordResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function toArray($request)
'accepted_on' => $this->accepted_on,
'withdrawn_on' => $this->withdrawn_on,

//relationships - if loaded
// relationships - if loaded
'region' => RegionResource::make($this->whenLoaded('region')),
'functional_area' => FunctionalAreaResource::make($this->whenLoaded('functionalArea')),
'manuscript_authors' => ManuscriptAuthorResource::collection($this->whenLoaded('manuscriptAuthors')),
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/ManuscriptRecordSummaryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function toArray($request)
'submitted_to_journal_on' => $this->submitted_to_journal_on,
'accepted_on' => $this->accepted_on,
'withdrawn_on' => $this->withdrawn_on,
//relationships - if loaded
// relationships - if loaded
'region' => RegionResource::make($this->whenLoaded('region')),
'manuscript_authors' => ManuscriptAuthorResource::collection($this->whenLoaded('manuscriptAuthors')),
'user' => UserResource::make($this->whenLoaded('user')),
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/SyncAuthorEmploymentWithOrcid.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private function createEmploymentRecordInOrcid(OrcidMemberAPIConnector $connecto

// there should be no putcode here; the only scneario where this
// is usefull is when the record is being updated after being
//mistakenly deleted in ORCID profile by user.
// mistakenly deleted in ORCID profile by user.
$employmentData->putCode = Optional::create();

$request = new PostEmploymentRequest($employmentData);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/ManuscriptRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,5 @@ public function validateIsFilled(bool $noExceptions = false): bool
return $validator->passes();
}

/// Scope methods
// / Scope methods
}
2 changes: 1 addition & 1 deletion app/Policies/PublicationPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function downloadMedia(User $user, Publication $publication, Media $media
return $user->can('view', $publication->manuscriptRecord);
}

//if it's a publication file and not under embargo, then it can be downloaded
// if it's a publication file and not under embargo, then it can be downloaded
if ($media->collection_name === MediaCollection::PUBLICATION->value) {
return ! $publication->isUnderEmbargo();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/UserPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function view(User $user, User $model)
{
// a user can view their own profile
return true;
//return $user->id === $model->id;
// return $user->id === $model->id;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/Ocrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
$fail(__('validation.orcid.prefix', ['attribute' => $attribute]));
}

//check remainder against only the ORCID part
// check remainder against only the ORCID part
$orcid = Str::substr($value, -19);

// check value against regex
Expand Down
2 changes: 1 addition & 1 deletion config/media-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
'-m 6', // for the slowest compression method in order to get the best compression.
'-pass 10', // for maximizing the amount of analysis pass.
'-mt', // multithreading for some speed improvements.
'-q 90', //quality factor that brings the least noticeable changes.
'-q 90', // quality factor that brings the least noticeable changes.
],
],

Expand Down
4 changes: 2 additions & 2 deletions config/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
/*
* Change this if you want to name the related pivots other than defaults
*/
'role_pivot_key' => null, //default 'role_id',
'permission_pivot_key' => null, //default 'permission_id',
'role_pivot_key' => null, // default 'role_id',
'permission_pivot_key' => null, // default 'permission_id',

/*
* Change this if you want to name the related model primary key other than
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function up()
$table->string('publisher', 255);

// add index for title_en
//$table->index('title_en');
// $table->index('title_en');
});
}
};
2 changes: 1 addition & 1 deletion tests/Feature/Auth/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function test_email_can_be_verified_for_user_with_invitation()

$this->assertNotNull($user->invitation->registered_at);
$this->assertTrue($user->hasVerifiedEmail());
//$this->assertNull($user->email_verification_token); //disabled because of MS SafeLink
// $this->assertNull($user->email_verification_token); //disabled because of MS SafeLink
$this->assertTrue($user->active);
$response->assertRedirect(config('app.frontend_url').'#/auth/login?verified=1'.'&email='.$user->email);

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/ManuscriptRecordSharingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
$mailable->assertSeeInHtml($shareable->shareable->title);
$mailable->assertSeeInHtml(now()->addDays(5)->format('Y-m-d'));

//check with null expires_at
// check with null expires_at
$shareable->update(['expires_at' => null]);

ray($mailable);
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Models/ManuscriptAuthorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

// this is there as if it doesn't exist we can't tell the frontend
// if the user can update or delete the record (e.g. AuthorChip)
//dd('data', $response->json('can'));
// dd('data', $response->json('can'));

expect($response->json('can'))->toMatchArray([
'update' => true,
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Models/PublicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
$response->assertCreated();
expect($response->json('data.file_name'))->toBe('test.pdf');
expect($response->json('data.uuid'))->toBeString();
//expect($response->json('data.publication_pdf'))->not()->toBeNull();
// expect($response->json('data.publication_pdf'))->not()->toBeNull();

$uuid = $response->json('data.uuid');

Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/Models/UserManuscriptRecordListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@
$response = $this->actingAs($user)->getJson('/api/my/manuscript-records?include-reviews=true')->assertOk();
expect($response->json('data'))->toHaveCount(3);

//filter by status - just draft
// filter by status - just draft
$response = $this->actingAs($user)->getJson('/api/my/manuscript-records?filter[status]='.ManuscriptRecordStatus::DRAFT->value)->assertOk();
expect($response->json('data'))->toHaveCount(2);

$manuscript2->status = ManuscriptRecordStatus::ACCEPTED;
$manuscript2->save();

//filter by status - just in review
// filter by status - just in review
$response = $this->actingAs($user)->getJson('/api/my/manuscript-records?include-reviews=true&filter[status]='.ManuscriptRecordStatus::IN_REVIEW->value)->assertOk();
expect($response->json('data'))->toHaveCount(1);

//filter by status - just accepted
// filter by status - just accepted
$response = $this->actingAs($user)->getJson('/api/my/manuscript-records?include-reviews=true&filter[status]='.ManuscriptRecordStatus::ACCEPTED->value)->assertOk();
expect($response->json('data'))->toHaveCount(1);
});

0 comments on commit 1efaf11

Please sign in to comment.