Completed
Push — master ( fd48c6...d6eea8 )
by Mike
02:42
created

RefreshToken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
c 2
b 1
f 0
lcom 0
cbo 1
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureData() 0 8 3
1
<?php
2
3
namespace SugarAPI\SDK\EntryPoint\POST;
4
5
6
use SugarAPI\SDK\EntryPoint\Abstracts\POST\JSONEntryPoint as POSTEntryPoint;
7
8
class RefreshToken extends POSTEntryPoint {
9
10
    protected $_REQUIRED_DATA = array(
11
        'grant_type',
12
        'refresh_token',
13
        'client_id',
14
        'client_secret'
15
    );
16
17
    /**
18
     * Configure Grant Type to be refresh_token
19
     * @param mixed $data
20
     * @return array|mixed
21
     */
22
    protected function configureData($data) {
23
        if (is_array($data)){
24
            $data['grant_type'] = 'refresh_token';
25
        }elseif (is_object($data)){
26
            $data->grant_type = 'refresh_token';
27
        }
28
        return $data;
29
    }
30
31
}