lib/PosixSemaphore.php
public static function create(string $id, int $maxLocks, int $permissions = 0600): self {
        if ($maxLocks < 1) {
            throw new \Error("Number of locks must be greater than 0");
        }

        $semaphore = new self($id);
        $semaphore->init($maxLocks, $permissions);
        return $semaphore;
    }
public static function create(string $id, int $maxLocks, int $permissions = 0600): self {
        if ($maxLocks < 1) {
            throw new \Error("Number of locks must be greater than 0");
        }

        $semaphore = new self($id);
        $semaphore->init($maxLocks, $permissions);
        return $semaphore;
    }
public static function create ( string $ id , int $ maxLocks , int $ permissions = 0600 ) : self { if ( $ maxLocks < 1 ) { throw new \ Error ( "Number of locks must be greater than 0" ) ; } $ semaphore = new self ( $ id ) ; $ semaphore -> init ( $ maxLocks , $ permissions ) ; return $ semaphore ; }
Creates a new semaphore with a given ID and number of locks.

@param string $id       The unique name for the new semaphore.
@param int $maxLocks    The maximum number of locks that can be acquired from the semaphore.
@param int $permissions Permissions to access the semaphore. Use file permission format specified as 0xxx.

@throws SyncException If the semaphore could not be created due to an internal error.
Creates a new semaphore with a given ID and number of locks .