| 1 | <?php | ||
| 12 | trait UpdateTrait | ||
| 13 | { | ||
| 14 | |||
| 15 | /** | ||
| 16 | * @param null $end string | ||
| 17 | * @return string | ||
| 18 | */ | ||
| 19 | abstract public function endpoint($end = null); | ||
| 20 | |||
| 21 | /** | ||
| 22 | * | ||
| 23 | * Update a resource for the given $id with the supplied array. | ||
| 24 | * | ||
| 25 | * @param int $id | ||
| 26 | * @param array $data | ||
| 27 | * @return array|null | ||
| 28 | * @throws \Freshdesk\Exceptions\AccessDeniedException | ||
| 29 | * @throws \Freshdesk\Exceptions\ApiException | ||
| 30 | * @throws \Freshdesk\Exceptions\AuthenticationException | ||
| 31 | * @throws \Freshdesk\Exceptions\ConflictingStateException | ||
| 32 | * @throws \Freshdesk\Exceptions\NotFoundException | ||
| 33 | * @throws \Freshdesk\Exceptions\RateLimitExceededException | ||
| 34 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException | ||
| 35 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException | ||
| 36 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException | ||
| 37 | * @throws \Freshdesk\Exceptions\ValidationException | ||
| 38 | */ | ||
| 39 | public function update($id, array $data) | ||
| 43 | |||
| 44 | } | 
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: