modifs.mineures sans commentaires
This commit is contained in:
parent
dc020a1a31
commit
94e1cb6e0c
|
@ -4,10 +4,6 @@ namespace nur\sery\wip\php\access;
|
|||
use nur\sery\cl;
|
||||
|
||||
abstract class AbstractAccess implements IAccess {
|
||||
function available(): bool {
|
||||
return $this->exists() && $this->get() !== false;
|
||||
}
|
||||
|
||||
function inc(): int {
|
||||
$value = (int)$this->get();
|
||||
$this->set(++$value);
|
||||
|
|
|
@ -23,6 +23,10 @@ class KeyAccess extends AbstractAccess {
|
|||
return $this->key !== null && cl::has($this->dest, $this->key);
|
||||
}
|
||||
|
||||
function available(): bool {
|
||||
return $this->exists() && $this->get() !== false;
|
||||
}
|
||||
|
||||
function get($default=null) {
|
||||
if ($this->key === null) return $default;
|
||||
return cl::get($this->dest, $this->key, $default);
|
||||
|
|
Loading…
Reference in New Issue