mirror of
https://github.com/amphp/parallel.git
synced 2025-07-24 15:01:59 +02:00
Add missed type declarations
This commit is contained in:
@@ -34,7 +34,7 @@ class PosixSemaphore implements Semaphore, \Serializable {
|
||||
*
|
||||
* @throws SemaphoreException If the semaphore could not be created due to an internal error.
|
||||
*/
|
||||
public function __construct($maxLocks, $permissions = 0600) {
|
||||
public function __construct(int $maxLocks, int $permissions = 0600) {
|
||||
if (!\extension_loaded("sysvmsg")) {
|
||||
throw new \Error(__CLASS__ . " requires the sysvmsg extension.");
|
||||
}
|
||||
@@ -48,8 +48,7 @@ class PosixSemaphore implements Semaphore, \Serializable {
|
||||
*
|
||||
* @throws SemaphoreException If the semaphore could not be created due to an internal error.
|
||||
*/
|
||||
private function init($maxLocks, $permissions) {
|
||||
$maxLocks = (int) $maxLocks;
|
||||
private function init(int $maxLocks, int $permissions) {
|
||||
if ($maxLocks < 1) {
|
||||
$maxLocks = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user