Skip to content

Commit

Permalink
Update styles with new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Apr 3, 2022
1 parent 9bada60 commit 1f89deb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 38 deletions.
12 changes: 3 additions & 9 deletions src/Barrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ final class Barrier
private readonly DeferredFuture $completion;

/**
* @param int $count
*
* @psalm-param positive-int $count
* @param positive-int $count
*/
public function __construct(int $count)
{
Expand All @@ -52,9 +50,7 @@ public function getCount(): int
}

/**
* @param int $count
*
* @psalm-param positive-int $count
* @param positive-int $count
*/
public function arrive(int $count = 1): void
{
Expand All @@ -75,9 +71,7 @@ public function arrive(int $count = 1): void
}

/**
* @param int $count
*
* @psalm-param positive-int $count
* @param positive-int $count
*/
public function register(int $count = 1): void
{
Expand Down
18 changes: 0 additions & 18 deletions src/SharedMemoryParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ final class SharedMemoryParcel implements Parcel
/**
* @param Mutex $mutex Mutex to control access to the shared memory. Recommended: Since lock {@see PosixSemaphore}
* wrapped in an instance of {@see SemaphoreMutex}.
* @param mixed $value
* @param int $size The initial size in bytes of the shared memory segment. It will automatically be
* expanded as necessary.
* @param int $permissions Permissions to access the semaphore. Use file permission format specified as
* 0xxx.
* @param Serializer|null $serializer
*
* @return self
*
* @throws ParcelException
* @throws SyncException
Expand All @@ -82,11 +78,7 @@ public static function create(
}

/**
* @param Mutex $mutex
* @param int $key Use {@see getKey()} on the creating process and send this key to another process.
* @param Serializer|null $serializer
*
* @return self
*
* @throws ParcelException
*/
Expand All @@ -110,10 +102,6 @@ public static function use(Mutex $mutex, int $key, ?Serializer $serializer = nul

private readonly Serializer $serializer;

/**
* @param int $key
* @param Serializer|null $serializer
*/
private function __construct(int $key, Mutex $mutex, ?Serializer $serializer = null)
{
if (!\extension_loaded("shmop")) {
Expand Down Expand Up @@ -189,10 +177,6 @@ public function __sleep()
}

/**
* @param mixed $value
* @param int $size
* @param int $permissions
*
* @throws ParcelException
* @throws \Error If the size or permissions are invalid.
*/
Expand Down Expand Up @@ -231,8 +215,6 @@ private function isFreed(): bool
}

/**
* @return mixed
*
* @throws ParcelException
* @throws SerializationException
*/
Expand Down
4 changes: 1 addition & 3 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
*
* @template T
*
* @param Mutex $mutex
* @param \Closure(...mixed):T $synchronized
* @param mixed ...$args
* @param \Closure(...):T $synchronized
*
* @return T The return value of the Closure.
*/
Expand Down
2 changes: 0 additions & 2 deletions test/AbstractSemaphoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ abstract class AbstractSemaphoreTest extends AsyncTestCase

/**
* @param int $locks Number of locks in the semaphore.
*
* @return Semaphore
*/
abstract public function createSemaphore(int $locks): Semaphore;

Expand Down
7 changes: 1 addition & 6 deletions test/PosixSemaphoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ public function tearDown(): void
delay(1);
}

/**
* @param int $locks
*
* @return PosixSemaphore
*/
public function createSemaphore(int $locks): Semaphore
public function createSemaphore(int $locks): PosixSemaphore
{
return PosixSemaphore::create($locks);
}
Expand Down

0 comments on commit 1f89deb

Please sign in to comment.