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

Fix preview generator semaphore typing #37722

Closed
wants to merge 1 commit into from

Conversation

provokateurin
Copy link
Member

Summary

Split out from #37390

Checklist

Signed-off-by: jld3103 <jld3103yt@gmail.com>
@@ -311,7 +312,7 @@ private function getSmallImagePreview(ISimpleFolder $previewFolder, File $file,
*
* @param int $semId
* @param int $concurrency
* @return false|resource the semaphore on success or false on failure
* @return false|resource|SysvSemaphore the semaphore on success or false on failure
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reasone resource still needs to be listed here because psalm gets confused otherwise

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is psalm saying? Most likely the stubs for this extension are not up to date with php 8, no?

@provokateurin provokateurin added this to the Nextcloud 27 milestone Apr 14, 2023
@@ -330,7 +331,7 @@ public static function guardWithSemaphore(int $semId, int $concurrency) {
/**
* Releases the semaphore acquired from {@see Generator::guardWithSemaphore()}.
*
* @param resource|bool $semId the semaphore identifier returned by guardWithSemaphore
* @param SysvSemaphore|bool $semId the semaphore identifier returned by guardWithSemaphore
* @return bool
*/
public static function unguardWithSemaphore($semId): bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to fix the call to is_resource in here, it will always be false

@@ -311,7 +312,7 @@ private function getSmallImagePreview(ISimpleFolder $previewFolder, File $file,
*
* @param int $semId
* @param int $concurrency
* @return false|resource the semaphore on success or false on failure
* @return false|resource|SysvSemaphore the semaphore on success or false on failure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is psalm saying? Most likely the stubs for this extension are not up to date with php 8, no?

@@ -330,7 +331,7 @@ public static function guardWithSemaphore(int $semId, int $concurrency) {
/**
* Releases the semaphore acquired from {@see Generator::guardWithSemaphore()}.
*
* @param resource|bool $semId the semaphore identifier returned by guardWithSemaphore
* @param SysvSemaphore|bool $semId the semaphore identifier returned by guardWithSemaphore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param SysvSemaphore|bool $semId the semaphore identifier returned by guardWithSemaphore
* @param SysvSemaphore|false $semId the semaphore identifier returned by guardWithSemaphore

Makes no sense to accept true, no?

This was referenced May 3, 2023
@blizzz blizzz mentioned this pull request May 17, 2023
@blizzz blizzz modified the milestones: Nextcloud 27, Nextcloud 28 May 23, 2023
@skjnldsv skjnldsv deleted the fix/preview-generator-semaphore branch March 14, 2024 07:50
@skjnldsv skjnldsv removed this from the Nextcloud 28 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants