ArrayRpcAdapter::adaptResponse()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 3
nc 3
nop 1
1
<?php
2
/**
3
 * This file is part of the Betfair library.
4
 *
5
 * (c) Daniele D'Angeli <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Betfair\Adapter;
11
12
class ArrayRpcAdapter implements AdapterInterface
13
{
14
    public function adaptResponse($response)
15
    {
16
        $data = json_decode($response, true);
17
        
18
        if (isset($data['result'])){
19
        	return $data['result'];
20
        }
21
        
22
        if (isset($data['error'])){
23
        	return $data['error'];
24
        }
25
    }
26
}
27