wp = $wp; $this->settings = $settings; } public function decorate($url) { $referralId = $this->settings->get(ReferralDetector::REFERRAL_SETTING_NAME, null); if ($referralId === null) { return $url; } return $this->wp->addQueryArg('ref', $referralId, $url); } }