class StubLockBackendAbstract

A stub of the abstract LockBackendAbstract class for testing purposes.

Hierarchy

Expanded class hierarchy of StubLockBackendAbstract

File

core/tests/Drupal/Tests/Core/Lock/StubLockBackendAbstract.php, line 12

Namespace

Drupal\Tests\Core\Lock
View source
class StubLockBackendAbstract extends LockBackendAbstract {
  
  /**
   * {@inheritdoc}
   */
  public function acquire($name, $timeout = 30.0) : bool {
    return TRUE;
  }
  
  /**
   * {@inheritdoc}
   */
  public function lockMayBeAvailable($name) : bool {
    throw new \LogicException(__METHOD__ . '() is not implemented.');
  }
  
  /**
   * {@inheritdoc}
   */
  public function release($name) : void {
  }
  
  /**
   * {@inheritdoc}
   */
  public function releaseAll($lockId = NULL) : void {
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
LockBackendAbstract::$lockId protected property Current page lock token identifier.
LockBackendAbstract::$locks protected property Existing locks for this page.
LockBackendAbstract::getLockId public function Gets the unique page token for locks. Overrides LockBackendInterface::getLockId
LockBackendAbstract::wait public function Waits a short amount of time before a second lock acquire attempt. Overrides LockBackendInterface::wait
StubLockBackendAbstract::acquire public function Acquires a lock. Overrides LockBackendInterface::acquire
StubLockBackendAbstract::lockMayBeAvailable public function Checks if a lock is available for acquiring. Overrides LockBackendInterface::lockMayBeAvailable
StubLockBackendAbstract::release public function Releases the given lock. Overrides LockBackendInterface::release
StubLockBackendAbstract::releaseAll public function Releases all locks for the given lock token identifier. Overrides LockBackendInterface::releaseAll

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.