From fe9047622da002a7a4a3943900fa589f54353e5b Mon Sep 17 00:00:00 2001 From: "vasily.pyatykh" Date: Mon, 4 Nov 2024 17:20:39 +0100 Subject: [PATCH] Make internal methods private --- src/IntercomAdmins.php | 2 +- src/IntercomCompanies.php | 10 +++++----- src/IntercomContacts.php | 2 +- src/IntercomConversations.php | 4 ++-- src/IntercomLeads.php | 22 +++++++++++----------- src/IntercomTeams.php | 2 +- src/IntercomUsers.php | 2 +- src/IntercomVisitors.php | 2 +- tests/IntercomAdminsTest.php | 6 ------ tests/IntercomCompaniesTest.php | 12 ------------ tests/IntercomConversationsTest.php | 12 ------------ tests/IntercomLeadsTest.php | 7 ------- tests/IntercomTeamsTest.php | 6 ------ tests/IntercomVisitorsTest.php | 6 ------ 14 files changed, 23 insertions(+), 72 deletions(-) diff --git a/src/IntercomAdmins.php b/src/IntercomAdmins.php index 75ed901c..447c267c 100644 --- a/src/IntercomAdmins.php +++ b/src/IntercomAdmins.php @@ -41,7 +41,7 @@ public function getAdmin($id, $options = []) * @param string $id * @return string */ - public function adminPath($id) + private function adminPath($id) { return 'admins/' . $id; } diff --git a/src/IntercomCompanies.php b/src/IntercomCompanies.php index e3256ad9..8754cf80 100644 --- a/src/IntercomCompanies.php +++ b/src/IntercomCompanies.php @@ -114,7 +114,7 @@ public function getCompanyUsers($id, $options = []) * @param string $id * @return string */ - public function companyPath($id) + private function companyPath($id) { return 'companies/' . $id; } @@ -123,7 +123,7 @@ public function companyPath($id) * @param string $id * @return string */ - public function companyUsersPath($id) + private function companyUsersPath($id) { return 'companies/' . $id . '/users'; } @@ -132,17 +132,17 @@ public function companyUsersPath($id) * @param string $contactId * @return string */ - public function companyAttachPath(string $contactId) + private function companyAttachPath(string $contactId) { return 'contacts/' . $contactId . '/companies'; } - + /** * @param string $contactId * @param string $companyId * @return string */ - public function companyDetachPath(string $contactId, string $companyId) + private function companyDetachPath(string $contactId, string $companyId) { return 'contacts/' . $contactId . '/companies/' . $companyId; } diff --git a/src/IntercomContacts.php b/src/IntercomContacts.php index 7cfc0739..09a67500 100644 --- a/src/IntercomContacts.php +++ b/src/IntercomContacts.php @@ -126,7 +126,7 @@ public function nextCursor($pages) * @param string $id * @return string */ - public function contactPath(string $id) + private function contactPath(string $id) { return 'contacts/' . $id; } diff --git a/src/IntercomConversations.php b/src/IntercomConversations.php index b38f387b..67a46188 100644 --- a/src/IntercomConversations.php +++ b/src/IntercomConversations.php @@ -127,7 +127,7 @@ public function markConversationAsRead($id) * @param string $id * @return string */ - public function conversationPath($id) + private function conversationPath($id) { return 'conversations/' . $id; } @@ -138,7 +138,7 @@ public function conversationPath($id) * @param string $id * @return string */ - public function conversationReplyPath($id) + private function conversationReplyPath($id) { return 'conversations/' . $id . '/reply'; } diff --git a/src/IntercomLeads.php b/src/IntercomLeads.php index 6ef1132d..3457ea9a 100644 --- a/src/IntercomLeads.php +++ b/src/IntercomLeads.php @@ -89,17 +89,6 @@ public function convertLead($options) return $this->client->post("contacts/convert", $options); } - /** - * Returns endpoint path to Lead with given ID. - * - * @param string $id - * @return string - */ - public function leadPath($id) - { - return "contacts/" . $id; - } - /** * Gets a list of Leads through the contacts scroll API. * @@ -112,4 +101,15 @@ public function scrollLeads($options = []) { return $this->client->get('contacts/scroll', $options); } + + /** + * Returns endpoint path to Lead with given ID. + * + * @param string $id + * @return string + */ + private function leadPath($id) + { + return "contacts/" . $id; + } } diff --git a/src/IntercomTeams.php b/src/IntercomTeams.php index b2a344b6..63e69130 100644 --- a/src/IntercomTeams.php +++ b/src/IntercomTeams.php @@ -41,7 +41,7 @@ public function getTeam($id, $options = []) * @param string $id * @return string */ - public function teamPath($id) + private function teamPath($id) { return 'teams/' . $id; } diff --git a/src/IntercomUsers.php b/src/IntercomUsers.php index 04b78757..8c3373ad 100644 --- a/src/IntercomUsers.php +++ b/src/IntercomUsers.php @@ -122,7 +122,7 @@ public function permanentlyDeleteUser(string $id) * @param string $id * @return string */ - public function userPath(string $id) + private function userPath(string $id) { return 'users/' . $id; } diff --git a/src/IntercomVisitors.php b/src/IntercomVisitors.php index c840a889..ec827bcf 100644 --- a/src/IntercomVisitors.php +++ b/src/IntercomVisitors.php @@ -70,7 +70,7 @@ public function convertVisitor($options) * @param string $id * @return string */ - public function visitorPath($id) + private function visitorPath($id) { return "visitors/" . $id; } diff --git a/tests/IntercomAdminsTest.php b/tests/IntercomAdminsTest.php index 89137993..3291a324 100644 --- a/tests/IntercomAdminsTest.php +++ b/tests/IntercomAdminsTest.php @@ -21,10 +21,4 @@ public function testAdminsGet() $users = new IntercomAdmins($this->client); $this->assertSame('foo', $users->getAdmin(1)); } - - public function testAdminsGetPath() - { - $users = new IntercomAdmins($this->client); - $this->assertSame('admins/1', $users->adminPath(1)); - } } diff --git a/tests/IntercomCompaniesTest.php b/tests/IntercomCompaniesTest.php index 7c3bd1d9..cc76d9ec 100644 --- a/tests/IntercomCompaniesTest.php +++ b/tests/IntercomCompaniesTest.php @@ -30,12 +30,6 @@ public function testCompanyGet() $this->assertSame('foo', $companies->getCompanies([])); } - public function testCompanyPath() - { - $users = new IntercomCompanies($this->client); - $this->assertSame('companies/foo', $users->companyPath("foo")); - } - public function testCompanyGetById() { $this->client->method('get')->willReturn('foo'); @@ -51,10 +45,4 @@ public function testCompanyGetUsers() $companies = new IntercomCompanies($this->client); $this->assertSame('foo', $companies->getCompanyUsers("foo")); } - - public function testCompanyUsersPath() - { - $users = new IntercomCompanies($this->client); - $this->assertSame('companies/foo/users', $users->companyUsersPath("foo")); - } } diff --git a/tests/IntercomConversationsTest.php b/tests/IntercomConversationsTest.php index 00c8f9ea..6a24f7d9 100644 --- a/tests/IntercomConversationsTest.php +++ b/tests/IntercomConversationsTest.php @@ -23,12 +23,6 @@ public function testConversationsList() $this->assertSame('foo', $users->getConversations([])); } - public function testConversationPath() - { - $users = new IntercomConversations($this->client); - $this->assertSame('conversations/foo', $users->conversationPath("foo")); - } - public function testGetConversation() { $this->client->method('get')->willReturn('foo'); @@ -58,12 +52,6 @@ public function testConversationNextSearch() $this->assertSame('foo', $conversations->nextSearch([], $pages)); } - public function testConversationReplyPath() - { - $users = new IntercomConversations($this->client); - $this->assertSame('conversations/foo/reply', $users->conversationReplyPath("foo")); - } - public function testReplyToConversation() { $this->client->method('post')->willReturn('foo'); diff --git a/tests/IntercomLeadsTest.php b/tests/IntercomLeadsTest.php index 092b8799..13875cd1 100644 --- a/tests/IntercomLeadsTest.php +++ b/tests/IntercomLeadsTest.php @@ -30,13 +30,6 @@ public function testLeadsList() $this->assertSame('foo', $leads->getLeads([])); } - public function testLeadPath() - { - - $leads = new IntercomLeads($this->client); - $this->assertSame("contacts/foo", $leads->leadPath("foo")); - } - public function testLeadsGet() { $this->client->method('get')->willReturn('foo'); diff --git a/tests/IntercomTeamsTest.php b/tests/IntercomTeamsTest.php index 2385cb9a..9522d0e1 100644 --- a/tests/IntercomTeamsTest.php +++ b/tests/IntercomTeamsTest.php @@ -21,10 +21,4 @@ public function testTeamsGet() $teams = new IntercomTeams($this->client); $this->assertSame('foo', $teams->getTeam(1)); } - - public function testTeamsGetPath() - { - $teams = new IntercomTeams($this->client); - $this->assertSame('teams/1', $teams->teamPath(1)); - } } diff --git a/tests/IntercomVisitorsTest.php b/tests/IntercomVisitorsTest.php index 26fd0196..516a46bf 100644 --- a/tests/IntercomVisitorsTest.php +++ b/tests/IntercomVisitorsTest.php @@ -14,12 +14,6 @@ public function testVisitorUpdate() $this->assertSame('foo', $visitors->update([])); } - public function testVisitorPath() - { - $visitors = new IntercomVisitors($this->client); - $this->assertSame("visitors/foo", $visitors->visitorPath("foo")); - } - public function testVisitorsGet() { $this->client->method('get')->willReturn('foo');