| 1 | <?php |
||
| 5 | trait Photos |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * List photos |
||
| 9 | * Get a single page from the list of all photos. |
||
| 10 | * @link https://unsplash.com/documentation#list-photos |
||
| 11 | * |
||
| 12 | * @return MarkSitko\LaravelUnsplash\Endpoints\Photos |
||
| 13 | */ |
||
| 14 | public function photos() |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get a photo |
||
| 24 | * Retrieve a single photo. |
||
| 25 | * @link https://unsplash.com/documentation#get-a-photo |
||
| 26 | * |
||
| 27 | * @param string $id |
||
| 28 | * @return MarkSitko\LaravelUnsplash\Endpoints\Photos |
||
| 29 | */ |
||
| 30 | public function photo( $id ) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get a random photo |
||
| 40 | * @link https://unsplash.com/documentation#get-a-random-photo |
||
| 41 | * |
||
| 42 | * @return MarkSitko\LaravelUnsplash\Endpoints\Photos |
||
| 43 | */ |
||
| 44 | public function randomPhoto() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get a photo’s statistics |
||
| 54 | * @link https://unsplash.com/documentation#get-a-photos-statistics |
||
| 55 | * |
||
| 56 | * @param string $id |
||
| 57 | * @return MarkSitko\LaravelUnsplash\Endpoints\Photos |
||
| 58 | */ |
||
| 59 | public function photosStatistics($id) |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Track a photo download |
||
| 69 | * @link https://unsplash.com/documentation#track-a-photo-download |
||
| 70 | * |
||
| 71 | * @param string $id |
||
| 72 | * @return MarkSitko\LaravelUnsplash\Endpoints\Photos |
||
| 73 | */ |
||
| 74 | public function trackPhotoDownload($id) |
||
| 81 | |||
| 82 | } |
||
| 83 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: