| 1 | <?php | ||
| 12 | trait ViewTrait | ||
| 13 | { | ||
| 14 | /** | ||
| 15 | * @param null $end string | ||
| 16 | * @return string | ||
| 17 | */ | ||
| 18 | abstract public function endpoint($end = null); | ||
| 19 | |||
| 20 | /** | ||
| 21 | * | ||
| 22 | * Get a resource by $id. Accepts an optional array of query parameters. | ||
| 23 | * | ||
| 24 | * @param int $id | ||
| 25 | * @param array|null $query | ||
| 26 | * @return array|null | ||
| 27 | * @throws \Freshdesk\Exceptions\AccessDeniedException | ||
| 28 | * @throws \Freshdesk\Exceptions\ApiException | ||
| 29 | * @throws \Freshdesk\Exceptions\AuthenticationException | ||
| 30 | * @throws \Freshdesk\Exceptions\ConflictingStateException | ||
| 31 | * @throws \Freshdesk\Exceptions\NotFoundException | ||
| 32 | * @throws \Freshdesk\Exceptions\RateLimitExceededException | ||
| 33 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException | ||
| 34 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException | ||
| 35 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException | ||
| 36 | * @throws \Freshdesk\Exceptions\ValidationException | ||
| 37 | */ | ||
| 38 | public function view($id, array $query = null) | ||
| 42 | |||
| 43 | } | 
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: