Completed
Push — master ( e6cd79...15515b )
by Mike
02:12
created

FileEntryPoint   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setupRequest() 0 3 1
A setupResponse() 0 3 1
A downloadTo() 0 4 1
1
<?php
2
3
namespace SugarAPI\SDK\EntryPoint\Abstracts\GET;
4
5
use SugarAPI\SDK\EntryPoint\Abstracts\GET\JSONEntryPoint as GETEntryPoint;
6
use SugarAPI\SDK\Request\GETFile;
7
use SugarAPI\SDK\Response\File as FileResponse;
8
9
class FileEntryPoint extends GETEntryPoint {
10
11
    protected $downloadDir = null;
12
13
    protected function setupRequest() {
14
        $this->Request = new GETFile();
15
    }
16
    protected function setupResponse() {
17
        $this->Response = new FileResponse($this->Request->getResponse(),$this->Request->getCurlObject(),$this->downloadDir);
18
    }
19
20
    public function downloadTo($path){
21
        $this->downloadDir = $path;
22
        return $this;
23
    }
24
25
}