29 SemaphoreLockStrategy::class =>
true,
30 FileLockStrategy::class =>
true,
31 SimpleLockStrategy::class => true
42 $interfaces = class_implements($className);
43 if (isset($interfaces[LockingStrategyInterface::class])) {
44 $this->lockingStrategy[$className] =
true;
46 throw new \InvalidArgumentException(
'The given class name ' . $className .
' does not implement the required LockingStrategyInterface interface.', 1425990198);
57 unset($this->lockingStrategy[$className]);
70 $queue = new \SplPriorityQueue();
73 foreach ($this->lockingStrategy as $method => $_) {
74 $supportedCapabilities = $capabilities & $method::getCapabilities();
75 if ($supportedCapabilities === $capabilities) {
76 $queue->insert($method, $method::getPriority());
79 if ($queue->count() > 0) {
80 $className = $queue->top();
83 return new $className($id);
85 throw new LockCreateException(
'Could not find a matching locking method with requested capabilities.', 1425990190);