1 | <?php |
||
15 | class Image extends AbstractApi |
||
16 | { |
||
17 | /** |
||
18 | * @var ImageMapper |
||
19 | */ |
||
20 | protected $imageMapper; |
||
21 | |||
22 | /** |
||
23 | * Image constructor. |
||
24 | * @param HttpClientInterface $httpClient |
||
25 | * @param ImageMapper $imageMapper |
||
26 | */ |
||
27 | public function __construct(HttpClientInterface $httpClient, ImageMapper $imageMapper) |
||
32 | |||
33 | /** |
||
34 | * Get image Information endpoint |
||
35 | * |
||
36 | * @param $id |
||
37 | * @return ImageInterface |
||
38 | */ |
||
39 | public function get($id) |
||
49 | |||
50 | /** |
||
51 | * Upload Image to Imgur |
||
52 | * |
||
53 | * @param string $image A binary file (path to file), base64 data, or a URL for an image. (up to 10MB) |
||
54 | * @param string $type Image type. Use Mechpave\ImgurClient\Model\ImageModel |
||
55 | * @param string $title The title of the image |
||
56 | * @param string $description The description of the image |
||
57 | * @param string $album The id of the album you want to add the image to. For anonymous albums, {album} should be the deletehash that is returned at creation. |
||
58 | * @param string $name The name of the file |
||
59 | * @throws \UnexpectedValueException |
||
60 | * @return ImageInterface |
||
61 | */ |
||
62 | public function upload( |
||
113 | |||
114 | /** |
||
115 | * Update uploaded image. You can only update title or description of the image |
||
116 | * |
||
117 | * @param string $id Imgur Id of the image. For anonymous image it must be deleteHash |
||
118 | * @param string $title The title of the image. |
||
119 | * @param string $description The description of the image |
||
120 | * @return bool |
||
121 | */ |
||
122 | public function update( |
||
144 | |||
145 | /** |
||
146 | * Delete image from Imgur |
||
147 | * |
||
148 | * @param string $id Imgur Id of the image. For anonymous image it must be deleteHash |
||
149 | * @return bool |
||
150 | */ |
||
151 | public function delete($id) |
||
159 | |||
160 | /** |
||
161 | * Favorite an image with the given ID. The user is required to be logged in to favorite the image. |
||
162 | * |
||
163 | * @param string $id Imgur Id of the image. |
||
164 | * @return bool |
||
165 | */ |
||
166 | public function favorite($id) |
||
174 | } |
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: