1<?
php declare(strict_types=1);
30 $this->handlers[$handler->getID()] = $handler;
31 if ($handler->isPrimary()) {
32 if ($this->primary !==
null) {
33 throw new \LogicException(
"Only one primary StorageHandler can exist");
35 $this->primary = $handler;
38 if ($this->primary ===
null) {
39 throw new \LogicException(
"One primary StorageHandler must exist");
54 if (isset($this->handlers[$storage_id])) {
55 return $this->handlers[$storage_id];
58 throw new \LogicException(
"no other StorageHandler possible at the moment");
An exception for terminatinating execution or to throw for unit testing.
Class StorageHandlerFactory.
getHandlerForStorageId(string $storage_id)
__construct(array $handlers)
StorageHandlerFactory constructor.
getHandlerForResource(StorableResource $resource)
Interface StorageResource.
Class FileResourceHandler.