|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Herbert\Envato\Stubs; |
| 4 | + |
| 5 | +use Herbert\Envato\ResultSet; |
| 6 | + |
| 7 | +/** |
| 8 | + * A collection of endpoints for browsing the Envato Market catalog. |
| 9 | + */ |
| 10 | +interface CatalogStub { |
| 11 | + |
| 12 | + /** |
| 13 | + * Returns details of, and items contained within, a public collection. |
| 14 | + * |
| 15 | + * ```php |
| 16 | + * $client->catalog->collection(['id' => 12345]); |
| 17 | + * ``` |
| 18 | + * |
| 19 | + * @param array $parameters |
| 20 | + * @return ResultSet |
| 21 | + * @see https://build.envato.com/api/#market_0_getCatalogCollection |
| 22 | + */ |
| 23 | + public function collection(array $parameters); |
| 24 | + |
| 25 | + /** |
| 26 | + * Returns all details of a particular item on Envato Market. |
| 27 | + * |
| 28 | + * ```php |
| 29 | + * $client->catalog->item(['id' => 12345]); |
| 30 | + * ``` |
| 31 | + * |
| 32 | + * @param array $parameters |
| 33 | + * @return ResultSet |
| 34 | + * @see https://build.envato.com/api/#market_0_getCatalogItem |
| 35 | + */ |
| 36 | + public function item(array $parameters); |
| 37 | + |
| 38 | + /** |
| 39 | + * Returns the latest available version of a theme/plugin. This is the recommended endpoint for Wordpress |
| 40 | + * theme/plugin authors building an auto-upgrade system into their item that needs to check if a new version is |
| 41 | + * available. |
| 42 | + * |
| 43 | + * ```php |
| 44 | + * $client->catalog->item_version(['id' => 12345]); |
| 45 | + * ``` |
| 46 | + * |
| 47 | + * @param array $parameters |
| 48 | + * @return ResultSet |
| 49 | + * @see https://build.envato.com/api/#market_0_getCatalogItemVersion |
| 50 | + */ |
| 51 | + public function item_version(array $parameters); |
| 52 | + |
| 53 | + /** |
| 54 | + * Search for items. |
| 55 | + * |
| 56 | + * ```php |
| 57 | + * $client->catalog->items(['site' => 'codecanyon.net', 'term' => '']); |
| 58 | + * ``` |
| 59 | + * |
| 60 | + * @param array $parameters |
| 61 | + * @return ResultSet |
| 62 | + * @see https://build.envato.com/api/#search_getSearchItem |
| 63 | + */ |
| 64 | + public function items(array $parameters); |
| 65 | + |
| 66 | + /** |
| 67 | + * Search for comments. |
| 68 | + * |
| 69 | + * ```php |
| 70 | + * $client->catalog->comments(['item_id' => 12345]); |
| 71 | + * ``` |
| 72 | + * |
| 73 | + * @param array $parameters |
| 74 | + * @return ResultSet |
| 75 | + * @see https://build.envato.com/api/#search_getSearchComment |
| 76 | + */ |
| 77 | + public function comments(array $parameters); |
| 78 | + |
| 79 | + /** |
| 80 | + * Returns the popular files for a particular site. Requires a site parameter, e.g. `themeforest`. |
| 81 | + * |
| 82 | + * ```php |
| 83 | + * $client->catalog->popular(['site' => 'codecanyon']); |
| 84 | + * ``` |
| 85 | + * |
| 86 | + * @param array $parameters |
| 87 | + * @return ResultSet |
| 88 | + * @see https://build.envato.com/api/#market_getPopular |
| 89 | + */ |
| 90 | + public function popular(array $parameters); |
| 91 | + |
| 92 | + /** |
| 93 | + * Lists the categories of a particular site. Requires a site parameter, e.g. `themeforest`. |
| 94 | + * |
| 95 | + * ```php |
| 96 | + * $client->catalog->categories(['site' => 'codecanyon']); |
| 97 | + * ``` |
| 98 | + * |
| 99 | + * @param array $parameters |
| 100 | + * @return ResultSet |
| 101 | + * @see https://build.envato.com/api/#market_getCategories |
| 102 | + */ |
| 103 | + public function categories(array $parameters); |
| 104 | + |
| 105 | + /** |
| 106 | + * Return available licenses and prices for the given item ID. |
| 107 | + * |
| 108 | + * ```php |
| 109 | + * $client->catalog->prices(['item_id' => 12345]); |
| 110 | + * ``` |
| 111 | + * |
| 112 | + * @param array $parameters |
| 113 | + * @return ResultSet |
| 114 | + * @see https://build.envato.com/api/#market_getItemPrices |
| 115 | + */ |
| 116 | + public function prices(array $parameters); |
| 117 | + |
| 118 | + /** |
| 119 | + * New files, recently uploaded to a particular site. Requires `site` and `category` parameters. |
| 120 | + * |
| 121 | + * ```php |
| 122 | + * $client->catalog->newest(['site' => 'codecanyon', 'category' => 'php-scripts']); |
| 123 | + * ``` |
| 124 | + * |
| 125 | + * @param array $parameters |
| 126 | + * @return ResultSet |
| 127 | + * @see https://build.envato.com/api/#market_getNewFiles |
| 128 | + */ |
| 129 | + public function newest(array $parameters); |
| 130 | + |
| 131 | + /** |
| 132 | + * Shows the current site features. |
| 133 | + * |
| 134 | + * ```php |
| 135 | + * $client->catalog->featured(['site' => 'codecanyon']); |
| 136 | + * ``` |
| 137 | + * |
| 138 | + * @param array $parameters |
| 139 | + * @return ResultSet |
| 140 | + * @see https://build.envato.com/api/#market_getFeatures |
| 141 | + */ |
| 142 | + public function featured(array $parameters); |
| 143 | + |
| 144 | + /** |
| 145 | + * Shows a random list of newly uploaded files from a particular site. Requires a site parameter, e.g. |
| 146 | + * `themeforest`. |
| 147 | + * |
| 148 | + * ```php |
| 149 | + * $client->catalog->random(['site' => 'codecanyon']); |
| 150 | + * ``` |
| 151 | + * |
| 152 | + * @param array $parameters |
| 153 | + * @return ResultSet |
| 154 | + * @see https://build.envato.com/api/#market_getRandomNewFiles |
| 155 | + */ |
| 156 | + public function random(array $parameters); |
| 157 | + |
| 158 | +} |
0 commit comments