*/ private array $objects = []; /** * @param mixed $source * @phpstan-return object */ public function map(string $signature, $source): object { return $this->objects[$signature] ?? new stdClass(); } /** * @param class-string $signature */ public function willReturn(string $signature, object $object): void { $this->objects[$signature] = $object; } }