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;
|
use nur\sery\cl;
|
||||||
|
|
||||||
abstract class AbstractAccess implements IAccess {
|
abstract class AbstractAccess implements IAccess {
|
||||||
function available(): bool {
|
|
||||||
return $this->exists() && $this->get() !== false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function inc(): int {
|
function inc(): int {
|
||||||
$value = (int)$this->get();
|
$value = (int)$this->get();
|
||||||
$this->set(++$value);
|
$this->set(++$value);
|
||||||
|
|
|
@ -23,6 +23,10 @@ class KeyAccess extends AbstractAccess {
|
||||||
return $this->key !== null && cl::has($this->dest, $this->key);
|
return $this->key !== null && cl::has($this->dest, $this->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function available(): bool {
|
||||||
|
return $this->exists() && $this->get() !== false;
|
||||||
|
}
|
||||||
|
|
||||||
function get($default=null) {
|
function get($default=null) {
|
||||||
if ($this->key === null) return $default;
|
if ($this->key === null) return $default;
|
||||||
return cl::get($this->dest, $this->key, $default);
|
return cl::get($this->dest, $this->key, $default);
|
||||||
|
|
Loading…
Reference in New Issue