-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
Signed-off-by: jld3103 <[email protected]>
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 | |||
* @return bool | |||
*/ | |||
public static function unguardWithSemaphore($semId): bool { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @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?
Summary
Split out from #37390
Checklist