Skip to content

Commit

Permalink
ci: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CalumTowers committed Jan 10, 2024
1 parent 7273875 commit 3b933f2
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/TeamSpeak/TeamSpeakCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function run(InputInterface $input, OutputInterface $output): int
/**
* Handling for a serverquery exception thrown by the TeamSpeak framework.
*/
protected static function handleServerQueryException(TeamSpeak3_Adapter_ServerQuery_Exception $e, Account $account = null)
protected static function handleServerQueryException(TeamSpeak3_Adapter_ServerQuery_Exception $e, ?Account $account = null)
{
if ($e->getCode() === TeamSpeak::CLIENT_INVALID_ID) {
self::$command->log('Invalid client ID.');
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Mship/InvalidStateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class InvalidStateException extends \Exception
{
private $state;

public function __construct(State $state = null)
public function __construct(?State $state = null)
{
$this->state = $state;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MaxConnectionAttemptsExceededException extends Exception
*
* @param string $attempts The number of connection attempts made. This is used as the exception code.
*/
public function __construct($attempts, Exception $previous = null)
public function __construct($attempts, ?Exception $previous = null)
{
parent::__construct($this->message, $attempts, $previous);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Smartcars/SmartcarsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getGuide()
return $this->viewMake('fte.guide');
}

public function getExercise(Flight $exercise = null)
public function getExercise(?Flight $exercise = null)
{
if (is_null($exercise)) {
$exercises = Flight::enabled()->orderBy('created_at')->get();
Expand Down Expand Up @@ -79,7 +79,7 @@ public function cancelExercise(Flight $exercise)
return redirect()->back()->with('success', 'Exercise booking successfully deleted.');
}

public function getHistory(Request $request, Pirep $pirep = null)
public function getHistory(Request $request, ?Pirep $pirep = null)
{
if (is_null($pirep)) {
$pireps = Pirep::query()->belongsTo($request->user()->id)->orderByDesc('created_at')->get();
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/Middleware/RateLimited.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RateLimited
/** @var int */
private $retryAfter;

public function __construct(string $key = null, ?int $allow = 50, ?int $every = 10, ?int $retryAfter = 10)
public function __construct(?string $key = null, ?int $allow = 50, ?int $every = 10, ?int $retryAfter = 10)
{
$this->key = $key ?? 'rate_limited_queue_job';
$this->allow = $allow ?? 50;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/NetworkData/Pilot.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function isOnline()
return $this->attributes['disconnected_at'] === null;
}

public function isAtAirport(Airport $airport = null)
public function isAtAirport(?Airport $airport = null)
{
if (is_null($airport)) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Training/WaitingList.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function removeFlag(WaitingListFlag $flag)
/**
* Add an Account to a waiting list.
*/
public function addToWaitingList(Account $account, Account $staffAccount, Carbon $createdAt = null)
public function addToWaitingList(Account $account, Account $staffAccount, ?Carbon $createdAt = null)
{
$timestamp = $createdAt != null ? $createdAt : Carbon::now();
$this->accounts()->attach($account, ['added_by' => $staffAccount->id]);
Expand Down
12 changes: 6 additions & 6 deletions app/Models/VisitTransfer/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ public function submit()
$this->facility->removeTrainingSpace();
}

public function markAsUnderReview($staffReason = null, Account $actor = null)
public function markAsUnderReview($staffReason = null, ?Account $actor = null)
{
$this->attributes['status'] = self::STATUS_UNDER_REVIEW;
$this->save();
Expand All @@ -651,7 +651,7 @@ public function markAsUnderReview($staffReason = null, Account $actor = null)
event(new ApplicationUnderReview($this));
}

public function reject($publicReason = 'No reason was provided.', $staffReason = null, Account $actor = null)
public function reject($publicReason = 'No reason was provided.', $staffReason = null, ?Account $actor = null)
{
$this->guardAgainstNonRejectableApplication();

Expand All @@ -678,7 +678,7 @@ public function reject($publicReason = 'No reason was provided.', $staffReason =
}
}

public function accept($staffComment = null, Account $actor = null)
public function accept($staffComment = null, ?Account $actor = null)
{
$this->guardAgainstUnAcceptableApplication();

Expand All @@ -705,14 +705,14 @@ public function accept($staffComment = null, Account $actor = null)
event(new ApplicationAccepted($this));
}

public function complete($staffComment = null, Account $actor = null)
public function complete($staffComment = null, ?Account $actor = null)
{
$this->guardAgainstNonAcceptedApplication();
$this->changeStatus(self::STATUS_COMPLETED, null, $staffComment, $actor);
event(new ApplicationCompleted($this));
}

public function cancel($publicReason = 'No reason was provided.', $staffReason = null, Account $actor = null)
public function cancel($publicReason = 'No reason was provided.', $staffReason = null, ?Account $actor = null)
{
$this->guardAgainstNonAcceptedApplication();
$this->changeStatus(self::STATUS_CANCELLED, $publicReason, $staffReason, $actor);
Expand All @@ -728,7 +728,7 @@ public function cancel($publicReason = 'No reason was provided.', $staffReason =
event(new ApplicationCancelled($this));
}

public function changeStatus($status, $publicReason = null, $staffReason = null, Account $actor = null)
public function changeStatus($status, $publicReason = null, $staffReason = null, ?Account $actor = null)
{
// Set the status
$this->status = $status;
Expand Down
4 changes: 2 additions & 2 deletions app/Models/VisitTransfer/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function submit($referenceContent)
event(new ReferenceUnderReview($this));
}

public function reject($publicReason = 'No reason was provided.', $staffReason = null, Account $actor = null)
public function reject($publicReason = 'No reason was provided.', $staffReason = null, ?Account $actor = null)
{
$this->guardAgainstNonUnderReviewReference();

Expand Down Expand Up @@ -319,7 +319,7 @@ public function cancel()
event(new ReferenceCancelled($this));
}

public function accept($staffComment = null, Account $actor = null)
public function accept($staffComment = null, ?Account $actor = null)
{
$this->guardAgainstNonUnderReviewReference();

Expand Down
2 changes: 1 addition & 1 deletion app/Policies/Mship/Account/BanPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function view(Account $account, Ban $ban)
*
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create(Account $account, Account $subject = null)
public function create(Account $account, ?Account $subject = null)
{
return $account->can('account.ban.create') && ! $subject?->is_banned;
}
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/FilamentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function registerMacros(): void
/**
* Configures a text column with a link which routes to the resource's view page
*/
\Filament\Tables\Columns\TextColumn::macro('viewResource', function (string $resourceClass, string $attribute = null): \Filament\Tables\Columns\TextColumn {
\Filament\Tables\Columns\TextColumn::macro('viewResource', function (string $resourceClass, ?string $attribute = null): \Filament\Tables\Columns\TextColumn {
/** @var \Filament\Tables\Actions\TextColumn $this */
$attribute = $attribute ?? explode('.', $this->getName())[0]; // We assume that the column name is like user or user.name - we want the first part to get the relation

Expand All @@ -66,7 +66,7 @@ protected function registerMacros(): void
/**
* Defines a relationship that is linked to a resource
*/
\Filament\Forms\Components\Select::macro('resourceRelationship', function (string $resourceClass, string $relationName = null, string $titleAttribute = null): \Filament\Forms\Components\Select {
\Filament\Forms\Components\Select::macro('resourceRelationship', function (string $resourceClass, ?string $relationName = null, ?string $titleAttribute = null): \Filament\Forms\Components\Select {
/** @var \Filament\Forms\Components\Select $this */
$relationModelName = class_basename($resourceClass::getModel());

Expand Down
2 changes: 1 addition & 1 deletion app/Services/Training/AddToWaitingList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AddToWaitingList implements BaseService

protected $createdAt;

public function __construct(WaitingList $waitingList, Account $account, Account $staffAccount, Carbon $created_at = null)
public function __construct(WaitingList $waitingList, Account $account, Account $staffAccount, ?Carbon $created_at = null)
{
$this->waitingList = $waitingList;
$this->account = $account;
Expand Down

0 comments on commit 3b933f2

Please sign in to comment.