*/ public array $identifiers, ) {} public function asArray(): array { return [...$this->identifiers, 't' => $this->type]; } public function isEqual(Subject $subject): bool { if ($subject->type !== $this->type) { return false; } foreach ($this->identifiers as $k => $identifierValue) { if (!array_key_exists($k, $subject->identifiers)) { return false; } if ($subject->identifiers[$k] !== $identifierValue) { return false; } } if (count($this->identifiers) !== count($subject->identifiers)) { return false; } return true; } }