/** * Retrieve the name from a service instance. * * @param ServiceInterface $oauthService * * @return string */ public static function getServiceName(ServiceInterface $oauthService) { if ($oauthService instanceof AbstractService) { return $oauthService->service(); } return preg_replace('/^.*\\\\/', '', get_class($oauthService)); }
/** * @param array $config * @param ServiceInterface $service * @param array $options * @param $id */ public function __construct(array $config, ServiceInterface $service, array $options, $id) { $this->config = $config; $this->service = $service; $this->options = $options; $this->id = $id; static::$provider = $service->service(); }