Skip to content

Commit 67035ba

Browse files
authored
Merge pull request #41289 from nextcloud/backport/41263/stable27
2 parents a9343ed + 0e768fa commit 67035ba

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

build/psalm-baseline.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,15 +3164,8 @@
31643164
<file src="lib/private/Preview/Generator.php">
31653165
<InvalidArgument>
31663166
<code>$maxPreviewImage</code>
3167-
<code>$semId</code>
31683167
<code>IPreview::EVENT</code>
31693168
</InvalidArgument>
3170-
<InvalidReturnStatement>
3171-
<code>$sem</code>
3172-
</InvalidReturnStatement>
3173-
<InvalidReturnType>
3174-
<code>false|resource</code>
3175-
</InvalidReturnType>
31763169
<MismatchingDocblockParamType>
31773170
<code>ISimpleFile</code>
31783171
</MismatchingDocblockParamType>

lib/private/Preview/Generator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public function generatePreviews(File $file, array $specifications, $mimeType =
227227
*
228228
* @param int $semId
229229
* @param int $concurrency
230-
* @return false|resource the semaphore on success or false on failure
230+
* @return false|\SysvSemaphore the semaphore on success or false on failure
231231
*/
232232
public static function guardWithSemaphore(int $semId, int $concurrency) {
233233
if (!extension_loaded('sysvsem')) {
@@ -246,11 +246,11 @@ public static function guardWithSemaphore(int $semId, int $concurrency) {
246246
/**
247247
* Releases the semaphore acquired from {@see Generator::guardWithSemaphore()}.
248248
*
249-
* @param resource|bool $semId the semaphore identifier returned by guardWithSemaphore
249+
* @param false|\SysvSemaphore $semId the semaphore identifier returned by guardWithSemaphore
250250
* @return bool
251251
*/
252-
public static function unguardWithSemaphore($semId): bool {
253-
if (!is_resource($semId) || !extension_loaded('sysvsem')) {
252+
public static function unguardWithSemaphore(false|\SysvSemaphore $semId): bool {
253+
if ($semId === false || !($semId instanceof \SysvSemaphore)) {
254254
return false;
255255
}
256256
return sem_release($semId);

0 commit comments

Comments
 (0)