1 | <?php |
||
11 | class File |
||
12 | { |
||
13 | /** |
||
14 | * @var ClientInterface |
||
15 | */ |
||
16 | private $guzzleClient; |
||
17 | |||
18 | /** |
||
19 | * @var Filesystem |
||
20 | */ |
||
21 | private $filesystem; |
||
22 | |||
23 | public function __construct(ClientInterface $guzzleClient = null) |
||
28 | |||
29 | /** |
||
30 | * @param $source |
||
31 | * @param null|string $destination |
||
32 | * |
||
33 | * @throws \Exception |
||
34 | * |
||
35 | * @return bool|string |
||
36 | */ |
||
37 | public function getFile($source, $destination = null) |
||
58 | |||
59 | /** |
||
60 | * @param string $url |
||
61 | * @param string $destination |
||
62 | * |
||
63 | * @throws CurlException |
||
64 | * @throws HttpStatusCodeException |
||
65 | * @throws \Exception |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function download($url, $destination) |
||
75 | |||
76 | /** |
||
77 | * @param string $file zipFile we want to open |
||
78 | * @param null|string $extractTo |
||
79 | * @param true|bool $delete |
||
80 | * |
||
81 | * @throws Exception |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | public function unZip($file, $extractTo = null, $delete = true) |
||
105 | } |
||
106 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: