@@ 39-48 (lines=10) @@ | ||
36 | * |
|
37 | * @return Post|ResponseInterface |
|
38 | */ |
|
39 | public function patchPost(string $postId, array $params) |
|
40 | { |
|
41 | if (empty($postId)) { |
|
42 | throw new InvalidArgumentException('PostId can not be empty'); |
|
43 | } |
|
44 | ||
45 | $response = $this->httpPut(sprintf('/posts/%s/patch', $postId), $params); |
|
46 | ||
47 | return $this->handleResponse($response, Post::class); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * Update a post. |
|
@@ 60-69 (lines=10) @@ | ||
57 | * |
|
58 | * @return Post|ResponseInterface |
|
59 | */ |
|
60 | public function updatePost(string $postId, array $params) |
|
61 | { |
|
62 | if (empty($postId)) { |
|
63 | throw new InvalidArgumentException('PostId can not be empty'); |
|
64 | } |
|
65 | ||
66 | $response = $this->httpPut(sprintf('/posts/%s', $postId), $params); |
|
67 | ||
68 | return $this->handleResponse($response, Post::class); |
|
69 | } |
|
70 | ||
71 | /** |
|
72 | * Get a single post. |