Completed
Push — master ( f16f73...9ec25c )
by Giovanni
10:08
created

Append   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 12 2
1
<?php
2
3
namespace REverse\GSheets\Operation;
4
5
use REverse\GSheets\Value;
6
7
class Append extends Operation
8
{
9
    const DEFAULT_PARAMS = [
10
        'valueInputOption' => 'RAW'
11
    ];
12
13
    public function execute(Value $value, $range, $params = [])
14
    {
15
        if (empty($params)) {
16
            $params = self::DEFAULT_PARAMS;
17
        }
18
19
        $service = $this->spreadsheets->getClient()->getGoogleServiceSheets();
20
        $service->spreadsheets_values->append(
21
            $this->spreadsheets->getSpreadSheetId(),
22
            $range,
23
            $value->getGoogleSheetsValueRange(),
24
            $params
25
        );
26
    }
27
}
28