Completed
Push — master ( 5e1f80...401c7c )
by Iurii
01:15
created

Google   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 10 2
1
<?php
2
3
/**
4
 * @package Social Login
5
 * @author Iurii Makukh <[email protected]>
6
 * @copyright Copyright (c) 2015, Iurii Makukh
7
 * @license https://www.gnu.org/licenses/gpl.html GNU/GPLv3
8
 */
9
10
namespace gplcart\modules\social_login\handlers;
11
12
/**
13
 * Contains methods for authorization with Google+
14
 */
15
class Google extends Provider
16
{
17
    /**
18
     * Process Google+ authorization
19
     * @param array $params
20
     * @param array $provider
21
     * @return mixed
22
     */
23
    public function authorize(array $params, array $provider)
24
    {
25
        $user = $this->request($params, 'https://www.googleapis.com/oauth2/v2/userinfo');
26
27
        if (!empty($user['verified_email'])) {
28
            return $this->submitUser($user, $provider);
29
        }
30
31
        return array();
32
    }
33
34
}
35