1 | <?php |
||
10 | class AssetDownloader |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $from; |
||
16 | |||
17 | /** |
||
18 | * @var Filesystem |
||
19 | */ |
||
20 | private $fileSystem; |
||
21 | |||
22 | /** |
||
23 | * @var Client |
||
24 | */ |
||
25 | private $httpClient; |
||
26 | |||
27 | /** |
||
28 | * @param array $config |
||
29 | * Allowed keys: |
||
30 | * - from type: Sting |
||
31 | * - destination type: Sting |
||
32 | * - httpClient type: @see Client |
||
33 | */ |
||
34 | public function __construct(array $config = []) |
||
54 | |||
55 | public function download(UriInterface $uri) |
||
62 | |||
63 | /** |
||
64 | * @param string $from |
||
65 | * |
||
66 | * @return self |
||
67 | */ |
||
68 | public function from($from) |
||
74 | |||
75 | /** |
||
76 | * @param string $to path to save the assets |
||
77 | * |
||
78 | * @return self |
||
79 | */ |
||
80 | public function to($to) |
||
87 | |||
88 | private function getFilesystem() |
||
96 | |||
97 | private function setHttpClient(Client $client) |
||
101 | |||
102 | private function setFilesystem(Filesystem $fileSystem) |
||
106 | } |
||
107 |