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

RefreshToken::configureData()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 8
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
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
}