Skip to content

Commit

Permalink
Remove API CRUD methods typehint
Browse files Browse the repository at this point in the history
API may not always return an object or array but only integers or
strings for example.

If CRUD methods force return type, it may throw TypeError exception.
  • Loading branch information
TZK- authored and Thibault GRANADA committed Dec 13, 2021
1 parent 61fdd68 commit 19b651c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ protected function findOne(string $endpoint, $id, array $filters = [])
* @param int $id
* @param $attributes
*
* @return array
* @return mixed|array
*/
protected function update(string $endpoint, $id, $attributes): array
protected function update(string $endpoint, $id, $attributes)
{
$key = $endpoint.'/'.$id.'?';

Expand All @@ -129,9 +129,9 @@ protected function update(string $endpoint, $id, $attributes): array
* @param string $endpoint
* @param $attributes
*
* @return array
* @return mixed|array
*/
protected function create(string $endpoint, $attributes): array
protected function create(string $endpoint, $attributes)
{
return $this->getTransport()->request('/'.$endpoint, $attributes, 'post') ?? [];
}
Expand All @@ -142,9 +142,9 @@ protected function create(string $endpoint, $attributes): array
* @param string $endpoint
* @param int $id
*
* @return array
* @return mixed|array
*/
protected function delete(string $endpoint, $id): array
protected function delete(string $endpoint, $id)
{
$key = $endpoint.'/'.$id.'?';
$this->deleteCache($key);
Expand Down

0 comments on commit 19b651c

Please sign in to comment.