Skip to content

Commit

Permalink
Merge pull request #968 from biigle/patch-1
Browse files Browse the repository at this point in the history
Upgrade PHP dependencies
  • Loading branch information
mzur authored Nov 7, 2024
2 parents 058f487 + 62e294a commit 4f762a7
Show file tree
Hide file tree
Showing 25 changed files with 479 additions and 588 deletions.
4 changes: 2 additions & 2 deletions app/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ abstract public function file();
/**
* The labels, this annotation got assigned by the users.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<covariant AnnotationLabel>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<covariant AnnotationLabel, $this>
*/
abstract public function labels();

Expand All @@ -179,7 +179,7 @@ abstract public function getFileIdAttribute();
/**
* The shape of this annotation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Shape, Annotation>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Shape, $this>
*/
public function shape()
{
Expand Down
4 changes: 2 additions & 2 deletions app/AnnotationSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AnnotationSession extends Model
/**
* The volume, this annotation session belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Volume, AnnotationSession>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Volume, $this>
*/
public function volume()
{
Expand All @@ -51,7 +51,7 @@ public function volume()
/**
* The users, this annotation session is restricted to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function users()
{
Expand Down
2 changes: 1 addition & 1 deletion app/ApiToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ApiToken extends Model
/**
* The user, this token belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, ApiToken>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
*/
public function owner()
{
Expand Down
2 changes: 1 addition & 1 deletion app/FederatedSearchInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function scopeWithRemoteToken($query)
/**
* The models that belong to this instance.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<FederatedSearchModel>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<FederatedSearchModel, $this>
*/
public function models()
{
Expand Down
4 changes: 2 additions & 2 deletions app/FederatedSearchModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function scopeVolumes($query)
/**
* The instance, this model belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<FederatedSearchInstance, FederatedSearchModel>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<FederatedSearchInstance, $this>
*/
public function instance()
{
Expand All @@ -68,7 +68,7 @@ public function instance()
/**
* The users who can access this model.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function users()
{
Expand Down
4 changes: 2 additions & 2 deletions app/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Image extends VolumeFile
/**
* The annotations on this image.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ImageAnnotation>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ImageAnnotation, $this>
*/
public function annotations()
{
Expand All @@ -76,7 +76,7 @@ public function annotations()
/**
* The labels, this image got attached by the users.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ImageLabel>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ImageLabel, $this>
*/
public function labels()
{
Expand Down
2 changes: 1 addition & 1 deletion app/ImageAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ImageAnnotation extends Annotation
/**
* The image, this annotation belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Image, ImageAnnotation>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Image, $this>
*/
public function image()
{
Expand Down
2 changes: 1 addition & 1 deletion app/ImageAnnotationLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ImageAnnotationLabel extends AnnotationLabel
/**
* The annotation, this annotation label belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<ImageAnnotation, ImageAnnotationLabel>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<ImageAnnotation, $this>
*/
public function annotation()
{
Expand Down
2 changes: 1 addition & 1 deletion app/ImageLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function file()
/**
* The image, this image label belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Image, ImageLabel>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Image, $this>
*/
public function image()
{
Expand Down
27 changes: 14 additions & 13 deletions app/Jobs/ProcessCloneVolumeFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,23 @@ public function __construct(Volume $volume, array $uuidMap, array $only = [])
*/
public function handle()
{
$query = $this->volume->files()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only));

if ($this->volume->isImageVolume()) {
$query->eachById(function (Image $img) {
$prefix = fragment_uuid_path($this->uuidMap[$img->uuid]);
CloneImageThumbnails::dispatch($img, $prefix);
});
$this->volume->images()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only))
->eachById(function (Image $img) {
$prefix = fragment_uuid_path($this->uuidMap[$img->uuid]);
CloneImageThumbnails::dispatch($img, $prefix);
});
} else {
$queue = config('videos.process_new_video_queue');
$query->eachById(
function (Video $video) use ($queue) {
$prefix = fragment_uuid_path($this->uuidMap[$video->uuid]);
CloneVideoThumbnails::dispatch($video, $prefix)->onQueue($queue);
}
);
$this->volume->videos()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only))
->eachById(
function (Video $video) use ($queue) {
$prefix = fragment_uuid_path($this->uuidMap[$video->uuid]);
CloneVideoThumbnails::dispatch($video, $prefix)->onQueue($queue);
}
);
}
}
}
11 changes: 6 additions & 5 deletions app/Jobs/ProcessNewVolumeFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ public function __construct(Volume $volume, array $only = [])
*/
public function handle()
{
$query = $this->volume->files()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only));

if ($this->volume->isImageVolume()) {
$query->eachById([ProcessNewImage::class, 'dispatch']);
$this->volume->images()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only))
->eachById([ProcessNewImage::class, 'dispatch']);
} else {
$queue = config('videos.process_new_video_queue');
$query->eachById(fn (Video $v) => ProcessNewVideo::dispatch($v)->onQueue($queue));
$this->volume->videos()
->when($this->only, fn ($query) => $query->whereIn('id', $this->only))
->eachById(fn (Video $v) => ProcessNewVideo::dispatch($v)->onQueue($queue));
}
}
}
6 changes: 3 additions & 3 deletions app/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function scopeUsed($query)
/**
* The parent label if the labels are ordered in a tree-like structure.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Label, Label>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Label, $this>
*/
public function parent()
{
Expand All @@ -95,7 +95,7 @@ public function parent()
/**
* The label tree this label belongs to.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTree, Label>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTree, $this>
*/
public function tree()
{
Expand All @@ -106,7 +106,7 @@ public function tree()
* The child labels of this label if they are ordered in a tree-like
* structue.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Label>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Label, $this>
*/
public function children()
{
Expand Down
14 changes: 7 additions & 7 deletions app/LabelTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function scopeGlobal($query)
/**
* The version of this label tree (if it is a version of a master label tree).
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTreeVersion, LabelTree>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTreeVersion, $this>
*/
public function version()
{
Expand All @@ -155,7 +155,7 @@ public function version()
/**
* The versions of this (master) label tree.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<LabelTreeVersion>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<LabelTreeVersion, $this>
*/
public function versions()
{
Expand All @@ -165,7 +165,7 @@ public function versions()
/**
* The visibility of the label tree.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Visibility, LabelTree>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Visibility, $this>
*/
public function visibility()
{
Expand All @@ -175,7 +175,7 @@ public function visibility()
/**
* The members of this label tree. Every member has a tree-specific role.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function members()
{
Expand All @@ -187,7 +187,7 @@ public function members()
/**
* The labels that belong to this tree.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Label>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Label, $this>
*/
public function labels()
{
Expand Down Expand Up @@ -265,7 +265,7 @@ public function memberCanBeRemoved(User $member)
/**
* The projects that are using this label tree.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Project>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Project, $this>
*/
public function projects()
{
Expand All @@ -275,7 +275,7 @@ public function projects()
/**
* The projects that are authorized to use this private label tree.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Project>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Project, $this>
*/
public function authorizedProjects()
{
Expand Down
2 changes: 1 addition & 1 deletion app/LabelTreeVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class LabelTreeVersion extends Model
/**
* The "master" label tree of this version.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTree, LabelTreeVersion>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<LabelTree, $this>
*/
public function labelTree()
{
Expand Down
24 changes: 12 additions & 12 deletions app/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function scopeAccessibleBy($query, User $user)
* The members of this project. Every member has a project-specific
* `project_role_id` besides their global user role.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function users()
{
Expand All @@ -80,7 +80,7 @@ public function users()
/**
* All members of this project with the `admin` role.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function admins()
{
Expand All @@ -90,7 +90,7 @@ public function admins()
/**
* All members of this project with the `editor` role.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function editors()
{
Expand All @@ -100,7 +100,7 @@ public function editors()
/**
* All members of this project with the `guest` role.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
*/
public function guests()
{
Expand All @@ -112,7 +112,7 @@ public function guests()
* automatically added to the project's users with the 'admin' role by
* the ProjectObserver.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, Project>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
*/
public function creator()
{
Expand All @@ -122,7 +122,7 @@ public function creator()
/**
* The project invitations of this project.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ProjectInvitation>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ProjectInvitation, $this>
*/
public function invitations()
{
Expand Down Expand Up @@ -182,7 +182,7 @@ public function removeUserId($userId)
/**
* The volumes of this project.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume, $this>
*/
public function volumes()
{
Expand All @@ -192,7 +192,7 @@ public function volumes()
/**
* The image volumes of this project.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume, $this>
*/
public function imageVolumes()
{
Expand All @@ -202,7 +202,7 @@ public function imageVolumes()
/**
* The video volumes of this project.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Volume, $this>
*/
public function videoVolumes()
{
Expand All @@ -212,7 +212,7 @@ public function videoVolumes()
/**
* The pending volumes of this project.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PendingVolume>
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PendingVolume, $this>
*/
public function pendingVolumes()
{
Expand Down Expand Up @@ -287,7 +287,7 @@ public function removeAllVolumes($force = false)
/**
* The label trees, this project is using.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<LabelTree>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<LabelTree, $this>
*/
public function labelTrees()
{
Expand All @@ -297,7 +297,7 @@ public function labelTrees()
/**
* The private label trees that authorized this project to use them.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<LabelTree>
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<LabelTree, $this>
*/
public function authorizedLabelTrees()
{
Expand Down
2 changes: 1 addition & 1 deletion app/ProjectInvitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ProjectInvitation extends Model
/**
* The project to which this invitation belongs.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Project, ProjectInvitation>
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Project, $this>
*/
public function project()
{
Expand Down
Loading

0 comments on commit 4f762a7

Please sign in to comment.