19declare(strict_types=1);
38 return isset($this->entries[$this->
keyOf($subject)][$namespace->
value()][$key]);
43 return $this->entries[$this->
keyOf($subject)][$namespace->
value()][$key] ??
null;
48 return $this->entries[$this->
keyOf($subject)][$namespace->
value()] ?? [];
53 $this->entries[$this->
keyOf($subject)][$namespace->
value()][$key] = $value;
58 unset($this->entries[$this->
keyOf($subject)][$namespace->
value()][$key]);
63 unset($this->entries[$this->
keyOf($subject)][$namespace->
value()]);
68 $this->remove_subject_calls++;
69 unset($this->entries[$this->
keyOf($subject)]);
74 $this->remove_subjects_calls++;
75 if ($subjects === []) {
79 foreach ($subjects as $subject) {
81 throw new \InvalidArgumentException(
'Expected a subject id.');
89 return $subject->
provider() .
':' . $subject->
id();
Isolates the keys of one consumer from every other consumer of a storage.
Identifies a subject within the provider that names it.
removeSubjects(array $subjects)
keyOf(SubjectId $subject)
removeFor(SubjectId $subject, StorageNamespace $namespace, string $key)
hasFor(SubjectId $subject, StorageNamespace $namespace, string $key)
int $remove_subjects_calls
int $remove_subject_calls
readFor(SubjectId $subject, StorageNamespace $namespace, string $key)
removeAllFor(SubjectId $subject, StorageNamespace $namespace)
removeSubject(SubjectId $subject)
Removes every entry of one subject, in every namespace.
writeFor(SubjectId $subject, StorageNamespace $namespace, string $key, string $value)
readAllFor(SubjectId $subject, StorageNamespace $namespace)
Every present entry of one subject in one namespace.
Subject-scoped operations on the same persistent table as {.