/** * inject the minimum required dependencies * @param \TheTwelve\Foursquare\EndpointGateway $gateway * @param null $userId */ protected function injectGatewayDependencies(EndpointGateway $gateway, $userId = null) { if (!is_null($userId)) { $gateway->setUserId($userId); } $gateway->setRequestUri($this->getRequestUri())->setToken($this->token)->setClientCredentials($this->clientId, $this->clientSecret); }