Skip to content

Conversation

@provokateurin
Copy link
Member

Summary

Split out from #37390

Checklist

* @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
* @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

* @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?

* 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.

5 participants