1 | <?php |
||
20 | class FooGallery_PixabayClient { |
||
|
|||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $optionsList = [ |
||
25 | 'key', |
||
26 | 'response_group', |
||
27 | 'id', |
||
28 | 'q', |
||
29 | 'lang', |
||
30 | 'callback', |
||
31 | 'image_type', |
||
32 | 'orientation', |
||
33 | 'category', |
||
34 | 'min_width', |
||
35 | 'min_height', |
||
36 | 'editors_choice', |
||
37 | 'safesearch', |
||
38 | 'page', |
||
39 | 'per_page', |
||
40 | 'pretty', |
||
41 | 'response_group', |
||
42 | 'order', |
||
43 | 'video_type' |
||
44 | ]; |
||
45 | |||
46 | /** |
||
47 | * Root of Pixabay REST API |
||
48 | */ |
||
49 | const API_ROOT = 'https://pixabay.com/api/'; |
||
50 | |||
51 | /** |
||
52 | * Get Data from Pixabay API |
||
53 | * |
||
54 | * @param $key |
||
55 | * @param $query |
||
56 | * @param int $count |
||
57 | * @param string $image_type |
||
58 | * @param string $response_group |
||
59 | * |
||
60 | * @param string $safesearch |
||
61 | * |
||
62 | * @return mixed |
||
63 | */ |
||
64 | public function search( $key, $query, $count = 20, $image_type = 'photo', $response_group = 'high_resolution', $safesearch = 'true') |
||
89 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.