mirror of
https://github.com/amphp/parallel.git
synced 2025-07-25 15:31:25 +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.
|
* @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")) {
|
if (!\extension_loaded("sysvmsg")) {
|
||||||
throw new \Error(__CLASS__ . " requires the sysvmsg extension.");
|
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.
|
* @throws SemaphoreException If the semaphore could not be created due to an internal error.
|
||||||
*/
|
*/
|
||||||
private function init($maxLocks, $permissions) {
|
private function init(int $maxLocks, int $permissions) {
|
||||||
$maxLocks = (int) $maxLocks;
|
|
||||||
if ($maxLocks < 1) {
|
if ($maxLocks < 1) {
|
||||||
$maxLocks = 1;
|
$maxLocks = 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user