Completed
Push — master ( 413b1b...035779 )
by Mahmoud
05:39 queued 01:09
created

GetUserSocialProfileTask::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\SocialAuthentication\Tasks;
4
5
use App\Containers\SocialAuthentication\Exceptions\MissingTokenException;
6
use Laravel\Socialite\Facades\Socialite;
7
8
/**
9
 * Class GetUserSocialProfileTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class GetUserSocialProfileTask
14
{
15
16
    /**
17
     * @param $provider
18
     *
19
     * @return  mixed
20
     */
21
    public function run($provider)
22
    {
23
        // This function will read the `Code` or the `oauth_token` variable from the
24
        // request to make a call and get the user data.
25
        $user = Socialite::driver($provider)->user();
26
27
        return $user;
28
    }
29
30
}
31