source = $source; $this->target = $target; } public function apply(mixed $data, MappingContext $context): mixed { if (! is_string($data)) { return $data; } return $data === $this->source ? $this->target : $data; } }