public function checkIfSemaphoreIsLocked($id, string $section): int
    {
        $key = $this->getSemaphoreKey($id, $section);

        if (!$this->cache->has($key, ['semaphore', $section])) {
            return 0;
        }

        return (int)$this->cache->get($key, ['semaphore', $section]);
    }
public function checkIfSemaphoreIsLocked($id, string $section): int
    {
        $key = $this->getSemaphoreKey($id, $section);

        if (!$this->cache->has($key, ['semaphore', $section])) {
            return 0;
        }

        return (int)$this->cache->get($key, ['semaphore', $section]);
    }
public function checkIfSemaphoreIsLocked ( $ id , string $ section ) : int { $ key = $ this -> getSemaphoreKey ( $ id , $ section ) ; if ( ! $ this -> cache -> has ( $ key , [ 'semaphore' , $ section ] ) ) { return 0 ; } return ( int ) $ this -> cache -> get ( $ key , [ 'semaphore' , $ section ] ) ; }
Check if a semaphore is locked or free. Return 1 if locked or 0 if unlocked.

@param string $id
@param string $section

@return int
Check if a semaphore is locked or free . Return 1 if locked or 0 if unlocked .