Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Nov 3, 2023
1 parent 531f5d1 commit b681cf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
7 changes: 0 additions & 7 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3075,14 +3075,7 @@
<file src="lib/private/Preview/Generator.php">
<InvalidArgument>
<code>$maxPreviewImage</code>
<code>$semId</code>
</InvalidArgument>
<InvalidReturnStatement>
<code>$sem</code>
</InvalidReturnStatement>
<InvalidReturnType>
<code>false|resource</code>
</InvalidReturnType>
<LessSpecificReturnType>
<code>null|string</code>
</LessSpecificReturnType>
Expand Down
8 changes: 4 additions & 4 deletions lib/private/Preview/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function generatePreviews(File $file, array $specifications, $mimeType =
*
* @param int $semId
* @param int $concurrency
* @return false|resource the semaphore on success or false on failure
* @return false|\SysvSemaphore the semaphore on success or false on failure
*/
public static function guardWithSemaphore(int $semId, int $concurrency) {
if (!extension_loaded('sysvsem')) {
Expand All @@ -240,11 +240,11 @@ 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 false|\SysvSemaphore $semId the semaphore identifier returned by guardWithSemaphore
* @return bool
*/
public static function unguardWithSemaphore($semId): bool {
if ($semId === false || get_class($semId) !== 'SysvSemaphore' || !extension_loaded('sysvsem')) {
public static function unguardWithSemaphore(false|\SysvSemaphore $semId): bool {
if ($semId === false || !($semId instanceof \SysvSemaphore)) {
return false;
}
return sem_release($semId);
Expand Down

0 comments on commit b681cf7

Please sign in to comment.