Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Dec 16, 2024
1 parent a2b2ffd commit fc25141
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 17 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/JobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
class JobsController extends Controller
{
/**
* List jobs executed on the server and the pending ones.
*
* @param ShowJobsRequest $request
*
* @return PaginatedDataCollection<(int|string),JobHistoryResource>
Expand Down
13 changes: 1 addition & 12 deletions app/Http/Controllers/Admin/Maintenance/FixTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,7 @@
class FixTree extends Controller
{
/**
* Clean the path from all files excluding $this->skip.
*
* @return int
*/
public function do(MaintenanceRequest $request): int
{
return Album::query()->fixTree();
}

/**
* Check whether there are files to be removed.
* If not, we will not display the module to reduce complexity.
* Check whether the Album tree is correct.
*
* @return TreeState
*/
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Admin/Maintenance/FullTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
class FullTree extends Controller
{
/**
* Clean the path from all files excluding $this->skip.
* Apply the fix suggested.
* ! This may break the installation. Not our problem.
*
* @return void
*/
Expand All @@ -28,8 +29,7 @@ public function do(FullTreeUpdateRequest $request): void
}

/**
* Check whether there are files to be removed.
* If not, we will not display the module to reduce complexity.
* Display the current full tree of albums.
*
* @return Collection<int,AlbumTree>
*/
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/Maintenance/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
class RegisterController extends Controller
{
/**
* Register the Lychee Supporter Edition license key.
*
* @param RegisterRequest $request
*
* @return RegisterData
Expand Down
14 changes: 14 additions & 0 deletions app/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
*/
class SettingsController extends Controller
{
/**
* Fetch all the settings available in Lychee.
*
* @param GetAllConfigsRequest $request
*
* @return ConfigCollectionResource
*/
public function getAll(GetAllConfigsRequest $request): ConfigCollectionResource
{
$editable_configs = Configs::query()
Expand All @@ -27,6 +34,13 @@ public function getAll(GetAllConfigsRequest $request): ConfigCollectionResource
return new ConfigCollectionResource($editable_configs);
}

/**
* Set a limited number of configurations with the new values.
*
* @param SetConfigsRequest $request
*
* @return ConfigCollectionResource
*/
public function setConfigs(SetConfigsRequest $request): ConfigCollectionResource
{
$configs = $request->configs();
Expand Down
8 changes: 8 additions & 0 deletions app/Http/Controllers/Admin/UpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public function __construct(ApplyUpdate $applyUpdate)
$this->applyUpdate = $applyUpdate;
}

/**
* Retrieve Update data from the server.
*
* @param UpdateRequest $request
* @param VersionInfo $versionInfo
*
* @return UpdateInfo
*/
public function get(UpdateRequest $request, VersionInfo $versionInfo): UpdateInfo
{
/** @var VersionChannelType $channelName */
Expand Down
43 changes: 43 additions & 0 deletions app/Http/Controllers/Gallery/AlbumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ public function get(GetAlbumRequest $request): AbstractAlbumResource
return new AbstractAlbumResource($config, $albumResource);
}

/**
* Create an album.
*
* @param AddAlbumRequest $request
*
* @return string
*/
public function createAlbum(AddAlbumRequest $request): string
{
/** @var int $ownerId */
Expand All @@ -92,11 +99,25 @@ public function createAlbum(AddAlbumRequest $request): string
return $create->create($request->title(), $request->parent_album())->id;
}

/**
* Create a tag album.
*
* @param AddAlbumRequest $request
*
* @return string
*/
public function createTagAlbum(AddTagAlbumRequest $request, CreateTagAlbum $create): string

Check failure on line 109 in app/Http/Controllers/Gallery/AlbumController.php

View workflow job for this annotation

GitHub Actions / 2️⃣ PHP 8.2 - PHPStan

PHPDoc tag @param for parameter $request with type App\Http\Requests\Album\AddAlbumRequest is incompatible with native type App\Http\Requests\Album\AddTagAlbumRequest.

Check failure on line 109 in app/Http/Controllers/Gallery/AlbumController.php

View workflow job for this annotation

GitHub Actions / 2️⃣ PHP 8.2 - PHPStan

PHPDoc tag @param for parameter $request with type App\Http\Requests\Album\AddAlbumRequest is incompatible with native type App\Http\Requests\Album\AddTagAlbumRequest.
{
return $create->create($request->title(), $request->tags())->id;
}

/**
* Update the info of an Album.
*
* @param AddAlbumRequest $request
*
* @return EditableBaseAlbumResource
*/
public function updateAlbum(UpdateAlbumRequest $request, SetHeader $setHeader): EditableBaseAlbumResource

Check failure on line 121 in app/Http/Controllers/Gallery/AlbumController.php

View workflow job for this annotation

GitHub Actions / 2️⃣ PHP 8.2 - PHPStan

PHPDoc tag @param for parameter $request with type App\Http\Requests\Album\AddAlbumRequest is incompatible with native type App\Http\Requests\Album\UpdateAlbumRequest.

Check failure on line 121 in app/Http/Controllers/Gallery/AlbumController.php

View workflow job for this annotation

GitHub Actions / 2️⃣ PHP 8.2 - PHPStan

PHPDoc tag @param for parameter $request with type App\Http\Requests\Album\AddAlbumRequest is incompatible with native type App\Http\Requests\Album\UpdateAlbumRequest.
{
$album = $request->album();
Expand Down Expand Up @@ -124,6 +145,13 @@ public function updateAlbum(UpdateAlbumRequest $request, SetHeader $setHeader):
return EditableBaseAlbumResource::fromModel($album);
}

/**
* Update the info of a Tag Album.
*
* @param UpdateTagAlbumRequest $request
*
* @return EditableBaseAlbumResource
*/
public function updateTagAlbum(UpdateTagAlbumRequest $request): EditableBaseAlbumResource
{
$album = $request->album();
Expand All @@ -142,6 +170,15 @@ public function updateTagAlbum(UpdateTagAlbumRequest $request): EditableBaseAlbu
return EditableBaseAlbumResource::fromModel($album);
}

/**
* Update the protection policy of an Abstract Album.
*
* @param SetAlbumProtectionPolicyRequest $request
* @param SetProtectionPolicy $setProtectionPolicy
* @param SetSmartProtectionPolicy $setSmartProtectionPolicy
*
* @return AlbumProtectionPolicy
*/
public function updateProtectionPolicy(SetAlbumProtectionPolicyRequest $request,
SetProtectionPolicy $setProtectionPolicy,
SetSmartProtectionPolicy $setSmartProtectionPolicy): AlbumProtectionPolicy
Expand Down Expand Up @@ -224,6 +261,8 @@ public function move(MoveAlbumsRequest $request, Move $move): void
}

/**
* Transfer the ownership of the album to another user.
*
* @param TransferAlbumRequest $request
* @param Transfer $transfer
*
Expand All @@ -235,6 +274,8 @@ public function transfer(TransferAlbumRequest $request, Transfer $transfer): voi
}

/**
* Set the album cover (the square thumb).
*
* @param SetAsCoverRequest $request
*
* @return void
Expand All @@ -247,6 +288,8 @@ public function cover(SetAsCoverRequest $request): void
}

/**
* Set the album header (the hero banner).
*
* @param $request
*
* @return void
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Gallery/AlbumsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
class AlbumsController extends Controller
{
/**
* Retrieve all the albums at the root.
*
* @return RootAlbumResource returns the top albums
*/
public function get(Top $top): RootAlbumResource
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Gallery/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getUploadCOnfig(): UploadConfig
}

/**
* Return global gallery config.
* Return the Footer data.
*
* @return FooterConfig
*/
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/Gallery/MapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ public function __construct()
$this->albumPositionData = resolve(AlbumPositionData::class);
}

/**
* Return the configuration data for the Map.
*
* @return MapProviderData
*/
public function getProvider(): MapProviderData
{
return new MapProviderData();
}

/**
* Return an image and the timeout if the frame is supported..
* Return the Map data for an album or root.
*
* @param MapDataRequest $request
*
Expand Down
22 changes: 22 additions & 0 deletions app/Http/Controllers/Gallery/PhotoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class PhotoController extends Controller
{
public const DISK_NAME = 'image-upload';

/**
* Upload a picture.
*
* @param UploadPhotoRequest $request
*
* @return UploadMetaResource
*/
public function upload(UploadPhotoRequest $request): UploadMetaResource
{
$meta = $request->meta();
Expand Down Expand Up @@ -95,6 +102,14 @@ private function process(
return $meta;
}

/**
* Upload a picture from a URL.
*
* @param FromUrlRequest $request
* @param FromUrl $fromUrl
*
* @return string
*/
public function fromUrl(FromUrlRequest $request, FromUrl $fromUrl): string
{
/** @var int $userId */
Expand All @@ -104,6 +119,13 @@ public function fromUrl(FromUrlRequest $request, FromUrl $fromUrl): string
return 'success';
}

/**
* Update the info of a picture.
*
* @param EditPhotoRequest $request
*
* @return PhotoResource
*/
public function update(EditPhotoRequest $request): PhotoResource
{
$photo = $request->photo();
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Gallery/SharingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
class SharingController extends Controller
{
/**
* Create a new Sharing link between a user and an album.
*
* @param AddSharingRequest $request
* @param Share $share
*
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/RSSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
class RSSController extends Controller
{
/**
* Get the RSS Feed.
*
* @param Generate $generate
*
* @return Collection<int,FeedItem>
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Controllers/StatisticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
class StatisticsController extends Controller
{
/**
* Fetch the used space per user.
*
* @param SpacePerUserRequest $request
* @param Spaces $spaces
*
Expand All @@ -30,6 +32,8 @@ public function getSpacePerUser(SpacePerUserRequest $request, Spaces $spaces): C
}

/**
* Fetch the used space per SizeVariant type.
*
* @param SpaceSizeVariantRequest $request
* @param Spaces $spaces
*
Expand All @@ -48,6 +52,8 @@ public function getSpacePerSizeVariantType(SpaceSizeVariantRequest $request, Spa
}

/**
* Fetch the used space and number of photos per Album (without descendants).
*
* @param SpacePerAlbumRequest $request
* @param Spaces $spaces
*
Expand All @@ -72,6 +78,7 @@ public function getSpacePerAlbum(SpacePerAlbumRequest $request, Spaces $spaces):
}

/**
* Fetch the used space and number of photos per Album with descendants
* ! Slow query.
*
* @param SpacePerAlbumRequest $request
Expand Down
7 changes: 7 additions & 0 deletions app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
*/
class UsersController extends Controller
{
/**
* Count the number of registered users.
*
* @param UsersRequest $_request
*
* @return int
*/
public function count(UsersRequest $_request): int
{
return User::count();
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/WebAuthn/WebAuthnManageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function list(ListCredentialsRequest $request): Collection
}

/**
* Delete a WebAuthn credential.
*
* @throws UnauthenticatedException
*/
public function delete(DeleteCredentialRequest $request): void
Expand Down

0 comments on commit fc25141

Please sign in to comment.