Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade dependencies #7524

Merged
merged 8 commits into from
Jan 29, 2025
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
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
yarn lint-staged
2 changes: 1 addition & 1 deletion app/Actions/Jetstream/UserProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __invoke(Request $request, array $data): array
]);

$webauthnKeys = $request->user()->webauthnKeys
->map(fn (WebauthnKey $key) => [
->map(fn (WebauthnKey $key) => [ // @phpstan-ignore-line
'id' => $key->id,
'name' => $key->name,
'type' => $key->type,
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Contact/Dav/Services/GetEtag.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function execute(array $data): string
/** @var VCardResource */
$entry = $data['entry'];

if ($entry->vault_id !== $this->vault->id) {
if ($entry->vault_id != $this->vault->id) {
throw new ModelNotFoundException;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getAddressBooksForUser($principalUri): array

private function getAddressBookDetails(Vault $vault): array
{
$token = $this->getCurrentSyncToken($vault->id);
$token = $this->getCurrentSyncToken((string) $vault->id);

$des = [
'id' => $vault->id,
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Contact/DavClient/Jobs/GetMultipleVCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private function run(): void
$data = $this->addressbookMultiget();

$jobs = collect($data)
->filter(fn (array $contact): bool => is_array($contact) && $contact['status'] === '200')
->filter(fn (array $contact): bool => $contact['status'] === '200')
->map(fn (array $contact, string $href): ?UpdateVCard => $this->updateVCard($contact, $href))
->filter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private function addContactInformationToVCard(VCard $vcard, ContactInformation $
case trans('Phone'):
// https://datatracker.ietf.org/doc/html/rfc6350#section-6.4.1
$vcard->add('TEL', $contactInformation->data, [
//'TYPE' => $contactInformation->contactInformationType->type,
// 'TYPE' => $contactInformation->contactInformationType->type,
]);
break;
case trans('Facebook'):
Expand Down
2 changes: 1 addition & 1 deletion app/Domains/Contact/ManageContact/Dav/ImportContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private function getExistingContact(VCard $vcard): ?Contact
$contact = null;

if (($uri = Arr::get($this->context->data, 'uri')) !== null) {
$contact = $backend->getObject($this->vault()->id, $uri);
$contact = $backend->getObject((string) $this->vault()->id, $uri);

if ($contact === null) {
$contact = Contact::firstWhere([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function copy(): void
$this->newContact = new Contact;

$this->newContact = $this->contact->replicate();
$this->newContact->vault_id = $this->newVault->id;
$this->newContact->vault_id = (string) $this->newVault->id;
$this->newContact->save();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function moveCompanyInformation(): void
{
if ($this->contact->company) {
if ($this->contact->company->contacts->count() === 1) {
$this->contact->company->vault_id = $this->newVault->id;
$this->contact->company->vault_id = (string) $this->newVault->id;
$this->contact->company->save();
} else {
$newCompany = (new CreateCompany)->execute([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ContactVCardController extends Controller
{
public function download(Request $request, Vault $vault, Contact $contact)
{
$cardData = $this->exportVCard($vault->id, $contact->id);
$cardData = $this->exportVCard((string) $vault->id, $contact->id);
$name = Str::of($contact->name)->slug(language: App::getLocale());

return Redirect::back()->with('flash', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function data(Vault $vault): Collection
]),
]);

return [
return [ // @phpstan-ignore-line
'id' => $group->id,
'name' => $group->name,
'url' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function data(Group $group): array
: $group->groupType->groupTypeRoles()
->orderBy('position')
->get()
->map(function (GroupTypeRole $role) use ($group) {
->map(function (GroupTypeRole $role) use ($group) { // @phpstan-ignore-line
$contactsCollection = $group->contacts()
->wherePivot('group_type_role_id', $role->id)
->get()
Expand All @@ -37,7 +37,7 @@ public static function data(Group $group): array
]),
]);

return [
return [ // @phpstan-ignore-line
'id' => $role->id,
'label' => $role->label,
'contacts' => $contactsCollection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public static function data(Contact $contact, User $user): array
$loansAsLoaner = $contact->loansAsLoaner()->where('settled', false)->get();
$loansAsLoanee = $contact->loansAsLoanee()->where('settled', false)->get();

$loans = $loansAsLoaner->concat($loansAsLoanee)->sortBy('loaned_at')->unique('id');

$loansAssociatedWithContactCollection = $loans->map(function ($loan) use ($contact, $user) {
return self::dtoLoan($loan, $contact, $user);
});
$loansAssociatedWithContactCollection = $loansAsLoaner
->concat($loansAsLoanee)
->sortBy('loaned_at')
->unique('id')
->map(fn (Loan $loan): array => self::dtoLoan($loan, $contact, $user)); // @phpstan-ignore-line

return [
'loans' => $loansAssociatedWithContactCollection,
Expand Down
4 changes: 3 additions & 1 deletion app/Domains/Settings/ManageUsers/Services/DestroyUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ private function validate(): void
{
$this->validateRules($this->data);

$this->user = $this->account()->users()
/** @var User */
$user = $this->account()->users()
->findOrFail($this->data['user_id']);
$this->user = $user;

if ($this->data['user_id'] === $this->data['author_id']) {
throw new ValidationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function execute(array $data): User
{
$this->validateRules($data);

/** @var User */
$user = $this->account()->users()
->findOrFail($data['user_id']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function execute(array $data): User
{
$this->validateRules($data);

/** @var User */
$user = $this->account()->users()
->findOrFail($data['user_id']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ class UserIndexViewHelper
{
public static function data(User $loggedUser): array
{
/** @var \Illuminate\Database\Eloquent\Collection<int,User> */
$users = $loggedUser->account->users;

$userCollection = $users->map(function ($user) use ($loggedUser) {
return self::dtoUser($user, $loggedUser);
});
$userCollection = $users->map(fn (User $user): array => self::dtoUser($user, $loggedUser));

return [
'users' => $userCollection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class AddPostToSliceOfLife extends BaseService implements ServiceInterface
{
private Post $post;

private ?SliceOfLife $slice;

private array $data;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ public static function postsInYear(Journal $journal, int $year, User $user): Col
*/
public static function yearsOfContentInJournal(Journal $journal): Collection
{
/** @var Collection<int,Post> */
$posts = Post::where('journal_id', $journal->id)
->select(DB::raw(SQLHelper::year('written_at').' as year'))
->distinct()
->orderBy('year', 'desc')
->get();

return $posts->map(fn (Post $post) => [
return $posts->map(fn (Post $post): array => [ // @phpstan-ignore-line
'year' => $post->year,
'posts' => Post::where('journal_id', $journal->id)
->whereYear('written_at', $post->year)
Expand Down Expand Up @@ -196,7 +197,7 @@ public static function tags(Journal $journal): Collection

public static function slices(Journal $journal): Collection
{
$slicesCollection = $journal
return $journal
->slicesOfLife()
->get()
->map(fn (SliceOfLife $slice) => [
Expand All @@ -212,7 +213,5 @@ public static function slices(Journal $journal): Collection
]),
],
]);

return $slicesCollection;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static function data(User $user): array
private static function getContacts(Vault $vault): Collection
{
return $vault->contacts
->random(fn (Collection $items): int => min(5, count($items)))
->random(fn (Collection $items): int => min(5, count($items))) // @phpstan-ignore-line
->map(fn (Contact $contact) => [
'id' => $contact->id,
'name' => $contact->name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function data(Vault $vault, User $user): Collection
$reminder = ContactReminder::where('id', $contactReminderScheduled->contact_reminder_id)->with('contact')->first();
$contact = $reminder->contact;

if ($contact->vault_id !== $vault->id) {
if ($contact->vault_id != $vault->id) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static function upcomingReminders(Vault $vault, User $user): array
$remindersCollection = $contactRemindersScheduled->map(function ($reminder) use ($vault, $user) {
$contact = $reminder->contact;

if ($contact->vault_id !== $vault->id) {
if ($contact->vault_id != $vault->id) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ private function validate(): void
{
$this->validateRules($this->data);

$this->user = $this->account()->users()
/** @var User */
$user = $this->account()->users()
->findOrFail($this->data['user_id']);
$this->user = $user;

if ($this->user->id === $this->author->id) {
throw new SameUserException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ private function validate(): void
{
$this->validateRules($this->data);

$this->user = $this->account()->users()
/** @var User */
$user = $this->account()->users()
->findOrFail($this->data['user_id']);
$this->user = $user;

if ($this->user->id === $this->author->id) {
throw new SameUserException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ private function validate(): void
{
$this->validateRules($this->data);

$this->user = $this->account()->users()
/** @var User */
$user = $this->account()->users()
->findOrFail($this->data['user_id']);
$this->user = $user;

if ($this->user->id === $this->author->id) {
throw new SameUserException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ public static function data(Vault $vault): array
$usersInAccount = $vault->account->users()->whereNotNull('email_verified_at')->get();
$usersInVault = $vault->users()->get();
$usersInAccount = $usersInAccount->diff($usersInVault);
$usersInAccountCollection = $usersInAccount->map(function ($user) use ($vault) {
return self::dtoUser($user, $vault);
});
$usersInVaultCollection = $usersInVault->map(function ($user) use ($vault) {
return self::dtoUser($user, $vault);
});
$usersInAccountCollection = $usersInAccount->map(fn (User $user): array => self::dtoUser($user, $vault)); // @phpstan-ignore-line
$usersInVaultCollection = $usersInVault->map(fn (User $user): array => self::dtoUser($user, $vault));

// labels
$labels = $vault->labels()
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Handler extends ExceptionHandler
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
* @var list<string>
*/
protected $dontFlash = [
'current_password',
Expand Down
6 changes: 1 addition & 5 deletions app/Helpers/CollectionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ public static function getCollator(?string $locale = null): \Collator
*/
protected static function valueRetriever(callable|string $value): callable
{
if (! is_string($value) && is_callable($value)) {
return $value;
}

return fn ($item) => data_get($item, $value);
return is_callable($value) ? $value : fn ($item) => data_get($item, $value);
}
}
2 changes: 1 addition & 1 deletion app/Helpers/ImportantDateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function determineType(ContactImportantDate $date): ?string
}

// case: only know the month and day. In this case, we can't calculate
//the age at all
// the age at all
if ($date->day && $date->month && ! $date->year) {
$type = ContactImportantDate::TYPE_MONTH_DAY;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/SocialiteCallbackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function callback(Request $request, string $driver): RedirectResponse
$this->checkProvider($driver);
$this->checkForErrors($request, $driver);

return $this->loginPipeline($request)->then(function (/*$request*/) {
return $this->loginPipeline($request)->then(function (/* $request */) {
return Redirect::intended(route('home'));
});
} catch (ValidationException $e) {
Expand Down
4 changes: 1 addition & 3 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class Authenticate extends Middleware
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
return ! $request->expectsJson() ? route('login') : null;
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/SanctumSetUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
*/
public function handle(Request $request, Closure $next)
{
$this->sanctum()->setUser($request->user()->withAccessToken(new TransientToken));
$this->sanctum()->setUser($request->user()->withAccessToken(new TransientToken)); // @phpstan-ignore-line

return $next($request);
}
Expand Down
Loading