芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/network.digitalhubbd.com/fns/hybridauth/Provider/Spotify.php
apiRequest('me'); $data = new Data\Collection($response); if (!$data->exists('id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('id'); $userProfile->displayName = $data->get('display_name'); $userProfile->email = $data->get('email'); $userProfile->emailVerified = $data->get('email'); $userProfile->profileURL = $data->filter('external_urls')->get('spotify'); $userProfile->photoURL = $data->filter('images')->get('url'); $userProfile->country = $data->get('country'); if ($data->exists('birthdate')) { $this->fetchBirthday($userProfile, $data->get('birthdate')); } return $userProfile; } /** * Fetch use birthday * * @param User\Profile $userProfile * @param $birthday * * @return User\Profile */ protected function fetchBirthday(User\Profile $userProfile, $birthday) { $result = (new Data\Parser())->parseBirthday($birthday); $userProfile->birthDay = (int)$result[0]; $userProfile->birthMonth = (int)$result[1]; $userProfile->birthYear = (int)$result[2]; return $userProfile; } }