From 651780296ac60a9bcac7bc685f7b0b5e0cb4c1b2 Mon Sep 17 00:00:00 2001 From: Sarti Hugo Date: Sat, 24 Feb 2018 16:14:18 -0300 Subject: [PATCH 1/2] Allow Delete calls --- src/Http/Method.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Method.php b/src/Http/Method.php index d0b5c8d..bd95661 100644 --- a/src/Http/Method.php +++ b/src/Http/Method.php @@ -72,7 +72,7 @@ class Method extends AbstractEnum */ public static function isMethodSupported($method) { - if (!in_array($method, [Method::GET, Method::POST])) { + if (!in_array($method, [Method::GET, Method::POST, Method::DELETE])) { throw new \InvalidArgumentException('The method is not correct'); } } From 0dc80ac8b555c1993036defb25e77b76d4d616be Mon Sep 17 00:00:00 2001 From: Sarti Hugo Date: Sat, 24 Feb 2018 17:13:35 -0300 Subject: [PATCH 2/2] Added helper method --- src/Client.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Client.php b/src/Client.php index 88fb4e3..d97cc3e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -532,6 +532,20 @@ public function post($endpoint, array $params = []) return $this->api($endpoint, $params, Method::POST); } + /** + * Make API call to LinkedIn using DELETE method + * + * @param string $endpoint + * @param array $params + * + * @return array + * @throws \LinkedIn\Exception + */ + public function delete($endpoint, array $params = []) + { + return $this->api($endpoint, $params, Method::DELETE); + } + /** * @param $path * @return array