From 207d17a74984ccc60550fe25b9fc02e7a2a246e9 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Mon, 20 May 2024 10:58:08 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/db/Capacitor.php | 24 +++++++++---------- ...ractCapacitor.php => CapacitorStorage.php} | 2 +- src/db/sqlite/SqliteCapacitor.php | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/db/{AbstractCapacitor.php => CapacitorStorage.php} (96%) diff --git a/src/db/Capacitor.php b/src/db/Capacitor.php index a0918c5..c094d6a 100644 --- a/src/db/Capacitor.php +++ b/src/db/Capacitor.php @@ -3,45 +3,45 @@ namespace nur\sery\db; /** * Class Capacitor: un objet permettant d'attaquer un canal spécique d'une - * instance de {@link AbstractCapacitor} + * instance de {@link CapacitorStorage} */ class Capacitor { - function __construct(AbstractCapacitor $capacitor, CapacitorChannel $channel) { - $this->capacitor = $capacitor; + function __construct(CapacitorStorage $storage, CapacitorChannel $channel) { + $this->storage = $storage; $this->channel = $channel; } - /** @var AbstractCapacitor */ - protected $capacitor; + /** @var CapacitorStorage */ + protected $storage; /** @var CapacitorChannel */ protected $channel; function exists(): bool { - return $this->capacitor->_exists($this->channel); + return $this->storage->_exists($this->channel); } function reset(): void { - $this->capacitor->_reset($this->channel); + $this->storage->_reset($this->channel); } function charge($item, ?callable $func=null, ?array $args=null): bool { - return $this->capacitor->_charge($this->channel, $item, $func, $args); + return $this->storage->_charge($this->channel, $item, $func, $args); } function discharge($filter=null, ?bool $reset=null): iterable { - return $this->capacitor->_discharge($this->channel, $filter, $reset); + return $this->storage->_discharge($this->channel, $filter, $reset); } function get($filter) { - return $this->capacitor->_get($this->channel, $filter); + return $this->storage->_get($this->channel, $filter); } function each($filter, callable $func, ?array $args=null): void { - $this->capacitor->_each($this->channel, $filter, $func, $args); + $this->storage->_each($this->channel, $filter, $func, $args); } function close(): void { - $this->capacitor->close(); + $this->storage->close(); } } diff --git a/src/db/AbstractCapacitor.php b/src/db/CapacitorStorage.php similarity index 96% rename from src/db/AbstractCapacitor.php rename to src/db/CapacitorStorage.php index 8d1ac7b..59a0353 100644 --- a/src/db/AbstractCapacitor.php +++ b/src/db/CapacitorStorage.php @@ -4,7 +4,7 @@ namespace nur\sery\db; /** * Class AbstractCapacitor: implémentation de base d'un {@link ICapacitor} */ -abstract class AbstractCapacitor implements ICapacitor { +abstract class CapacitorStorage implements ICapacitor { abstract protected function getChannel(?string $name): CapacitorChannel; abstract function _exists(CapacitorChannel $channel): bool; diff --git a/src/db/sqlite/SqliteCapacitor.php b/src/db/sqlite/SqliteCapacitor.php index 2943ca7..d1fbfef 100644 --- a/src/db/sqlite/SqliteCapacitor.php +++ b/src/db/sqlite/SqliteCapacitor.php @@ -2,15 +2,15 @@ namespace nur\sery\db\sqlite; use nur\sery\cl; -use nur\sery\db\AbstractCapacitor; use nur\sery\db\CapacitorChannel; +use nur\sery\db\CapacitorStorage; use nur\sery\php\func; use nur\sery\ValueException; /** * Class SqliteCapacitor */ -class SqliteCapacitor extends AbstractCapacitor{ +class SqliteCapacitor extends CapacitorStorage { function __construct($sqlite) { $this->sqlite = Sqlite::with($sqlite); }