From 8c05a56b14538d7903f0c831f11ba6f710f53844 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 14:45:04 +0300 Subject: [PATCH 1/3] Codestyle fix --- lib/Config.php | 2 -- lib/Discovery/Auth/Discovery.php | 4 +--- lib/Discovery/Auth/OAuth/Discovery.php | 4 +--- .../Automation/Actions/Discovery.php | 4 +--- lib/Discovery/Automation/Discovery.php | 4 +--- lib/Discovery/Cms/AuditLogs/Discovery.php | 4 +--- lib/Discovery/Cms/Blogs/Authors/Discovery.php | 4 +--- .../Cms/Blogs/BlogPosts/Discovery.php | 4 +--- lib/Discovery/Cms/Blogs/Discovery.php | 4 +--- lib/Discovery/Cms/Blogs/Tags/Discovery.php | 4 +--- lib/Discovery/Cms/Domains/Discovery.php | 4 +--- lib/Discovery/Cms/Hubdb/Discovery.php | 4 +--- lib/Discovery/Cms/Performance/Discovery.php | 4 +--- lib/Discovery/Cms/SiteSearch/Discovery.php | 4 +--- lib/Discovery/Cms/SourceCode/Discovery.php | 4 +--- lib/Discovery/Cms/UrlRedirects/Discovery.php | 4 +--- .../CommunicationPreferences/Discovery.php | 4 +--- lib/Discovery/Conversations/Discovery.php | 4 +--- .../VisitorIdentification/Discovery.php | 4 +--- lib/Discovery/Crm/Associations/Discovery.php | 4 +--- .../Crm/Associations/Schema/Discovery.php | 4 +--- .../Crm/Associations/V4/Discovery.php | 4 +--- .../Crm/Associations/V4/Schema/Discovery.php | 4 +--- lib/Discovery/Crm/Companies/Discovery.php | 4 +--- lib/Discovery/Crm/Deals/Discovery.php | 4 +--- .../Crm/Extensions/Accounting/Discovery.php | 4 +--- .../Crm/Extensions/Calling/Discovery.php | 4 +--- .../Crm/Extensions/Cards/Discovery.php | 4 +--- lib/Discovery/Crm/Extensions/Discovery.php | 4 +--- .../Videoconferencing/Discovery.php | 4 +--- lib/Discovery/Crm/Imports/Discovery.php | 4 +--- lib/Discovery/Crm/LineItems/Discovery.php | 4 +--- lib/Discovery/Crm/Objects/Calls/Discovery.php | 4 +--- .../Crm/Objects/Communications/Discovery.php | 4 +--- .../Crm/Objects/Emails/Discovery.php | 4 +--- .../Objects/FeedbackSubmissions/Discovery.php | 4 +--- .../Crm/Objects/Meetings/Discovery.php | 4 +--- lib/Discovery/Crm/Objects/Notes/Discovery.php | 4 +--- .../Crm/Objects/PostalMail/Discovery.php | 4 +--- lib/Discovery/Crm/Objects/Tasks/Discovery.php | 4 +--- lib/Discovery/Crm/Pipelines/Discovery.php | 4 +--- lib/Discovery/Crm/Products/Discovery.php | 4 +--- lib/Discovery/Crm/Properties/Discovery.php | 4 +--- lib/Discovery/Crm/Quotes/Discovery.php | 4 +--- lib/Discovery/Crm/Schemas/Discovery.php | 4 +--- lib/Discovery/Crm/Tickets/Discovery.php | 4 +--- lib/Discovery/Crm/Timeline/Discovery.php | 4 +--- lib/Discovery/Discovery.php | 18 +++++++++--------- lib/Discovery/DiscoveryBase.php | 13 +++++-------- lib/Discovery/Files/Discovery.php | 4 +--- lib/Discovery/Marketing/Discovery.php | 4 +--- lib/Discovery/Marketing/Events/Discovery.php | 4 +--- lib/Discovery/Marketing/Forms/Discovery.php | 4 +--- .../Marketing/Transactional/Discovery.php | 4 +--- lib/Discovery/Webhooks/Discovery.php | 4 +--- lib/RetryMiddlewareFactory.php | 8 -------- lib/Utils/Signature.php | 19 ++----------------- tests/Unit/Http/RequestTest.php | 1 + tests/Unit/Utils/OAuth2Test.php | 1 + tests/Unit/Utils/SignatureTest.php | 6 +++--- 60 files changed, 73 insertions(+), 203 deletions(-) diff --git a/lib/Config.php b/lib/Config.php index e6261c63a..e7be7bc3d 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -32,8 +32,6 @@ public function __construct() } /** - * @param $clientConfigClassName - * * @return Configuration */ public function convertToClientConfig($clientConfigClassName) diff --git a/lib/Discovery/Auth/Discovery.php b/lib/Discovery/Auth/Discovery.php index bc5742afb..680241c65 100644 --- a/lib/Discovery/Auth/Discovery.php +++ b/lib/Discovery/Auth/Discovery.php @@ -7,6 +7,4 @@ /** * @method OAuth\Discovery oAuth() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Auth/OAuth/Discovery.php b/lib/Discovery/Auth/OAuth/Discovery.php index a8671173c..7c2f0756c 100644 --- a/lib/Discovery/Auth/OAuth/Discovery.php +++ b/lib/Discovery/Auth/OAuth/Discovery.php @@ -12,6 +12,4 @@ * @method RefreshTokensApi refreshTokensApi() * @method TokensApi tokensApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Automation/Actions/Discovery.php b/lib/Discovery/Automation/Actions/Discovery.php index e5bb7da48..62e5982b9 100644 --- a/lib/Discovery/Automation/Actions/Discovery.php +++ b/lib/Discovery/Automation/Actions/Discovery.php @@ -14,6 +14,4 @@ * @method FunctionsApi functionsApi() * @method RevisionsApi revisionsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Automation/Discovery.php b/lib/Discovery/Automation/Discovery.php index 58edeff55..ffea5139f 100644 --- a/lib/Discovery/Automation/Discovery.php +++ b/lib/Discovery/Automation/Discovery.php @@ -7,6 +7,4 @@ /** * @method Actions\Discovery actions() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/AuditLogs/Discovery.php b/lib/Discovery/Cms/AuditLogs/Discovery.php index eadf2b767..c552adac1 100644 --- a/lib/Discovery/Cms/AuditLogs/Discovery.php +++ b/lib/Discovery/Cms/AuditLogs/Discovery.php @@ -8,6 +8,4 @@ /** * @method AuditLogsApi auditLogsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Blogs/Authors/Discovery.php b/lib/Discovery/Cms/Blogs/Authors/Discovery.php index 8cb060008..dbb507edd 100644 --- a/lib/Discovery/Cms/Blogs/Authors/Discovery.php +++ b/lib/Discovery/Cms/Blogs/Authors/Discovery.php @@ -8,6 +8,4 @@ /** * @method BlogAuthorsApi blogAuthorsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Blogs/BlogPosts/Discovery.php b/lib/Discovery/Cms/Blogs/BlogPosts/Discovery.php index b7ac3fc19..6ab1555f7 100644 --- a/lib/Discovery/Cms/Blogs/BlogPosts/Discovery.php +++ b/lib/Discovery/Cms/Blogs/BlogPosts/Discovery.php @@ -8,6 +8,4 @@ /** * @method BlogPostsApi blogPostsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Blogs/Discovery.php b/lib/Discovery/Cms/Blogs/Discovery.php index a344e6b5a..0ae16ec60 100644 --- a/lib/Discovery/Cms/Blogs/Discovery.php +++ b/lib/Discovery/Cms/Blogs/Discovery.php @@ -9,6 +9,4 @@ * @method BlogPosts\Discovery blogPosts() * @method Tags\Discovery tags() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Blogs/Tags/Discovery.php b/lib/Discovery/Cms/Blogs/Tags/Discovery.php index d1db101dd..6d5ff90bc 100644 --- a/lib/Discovery/Cms/Blogs/Tags/Discovery.php +++ b/lib/Discovery/Cms/Blogs/Tags/Discovery.php @@ -8,6 +8,4 @@ /** * @method BlogTagsApi blogTagsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Domains/Discovery.php b/lib/Discovery/Cms/Domains/Discovery.php index 66e8ecd66..f3da7e5ed 100644 --- a/lib/Discovery/Cms/Domains/Discovery.php +++ b/lib/Discovery/Cms/Domains/Discovery.php @@ -8,6 +8,4 @@ /** * @method DomainsApi domainsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Hubdb/Discovery.php b/lib/Discovery/Cms/Hubdb/Discovery.php index 260dafa9d..b9da8b5cf 100644 --- a/lib/Discovery/Cms/Hubdb/Discovery.php +++ b/lib/Discovery/Cms/Hubdb/Discovery.php @@ -12,6 +12,4 @@ * @method RowsBatchApi rowsBatchApi() * @method TablesApi tablesApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Performance/Discovery.php b/lib/Discovery/Cms/Performance/Discovery.php index a78fbccbe..8a0a09d57 100644 --- a/lib/Discovery/Cms/Performance/Discovery.php +++ b/lib/Discovery/Cms/Performance/Discovery.php @@ -8,6 +8,4 @@ /** * @method PublicPerformanceApi publicPerformanceApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/SiteSearch/Discovery.php b/lib/Discovery/Cms/SiteSearch/Discovery.php index 4b2ebec86..f8bdda0cf 100644 --- a/lib/Discovery/Cms/SiteSearch/Discovery.php +++ b/lib/Discovery/Cms/SiteSearch/Discovery.php @@ -8,6 +8,4 @@ /** * @method PublicApi publicApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/SourceCode/Discovery.php b/lib/Discovery/Cms/SourceCode/Discovery.php index 10d5d8bdd..19a6a1bb9 100644 --- a/lib/Discovery/Cms/SourceCode/Discovery.php +++ b/lib/Discovery/Cms/SourceCode/Discovery.php @@ -16,6 +16,4 @@ * @method SourceCodeExtractApi sourceCodeExtractApi() * @method ValidationApi validationApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/UrlRedirects/Discovery.php b/lib/Discovery/Cms/UrlRedirects/Discovery.php index 33e014949..8a5758eff 100644 --- a/lib/Discovery/Cms/UrlRedirects/Discovery.php +++ b/lib/Discovery/Cms/UrlRedirects/Discovery.php @@ -8,6 +8,4 @@ /** * @method RedirectsApi redirectsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/CommunicationPreferences/Discovery.php b/lib/Discovery/CommunicationPreferences/Discovery.php index 7b2d1b443..386d2a6c8 100644 --- a/lib/Discovery/CommunicationPreferences/Discovery.php +++ b/lib/Discovery/CommunicationPreferences/Discovery.php @@ -10,6 +10,4 @@ * @method DefinitionApi definitionApi() * @method StatusApi statusApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Conversations/Discovery.php b/lib/Discovery/Conversations/Discovery.php index 07d975bb0..32178b050 100644 --- a/lib/Discovery/Conversations/Discovery.php +++ b/lib/Discovery/Conversations/Discovery.php @@ -7,6 +7,4 @@ /** * @method VisitorIdentification\Discovery visitorIdentification() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Conversations/VisitorIdentification/Discovery.php b/lib/Discovery/Conversations/VisitorIdentification/Discovery.php index a9b3596e5..f2682f122 100644 --- a/lib/Discovery/Conversations/VisitorIdentification/Discovery.php +++ b/lib/Discovery/Conversations/VisitorIdentification/Discovery.php @@ -8,6 +8,4 @@ /** * @method GenerateApi generateApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Associations/Discovery.php b/lib/Discovery/Crm/Associations/Discovery.php index 227fc3978..9fc85ed77 100644 --- a/lib/Discovery/Crm/Associations/Discovery.php +++ b/lib/Discovery/Crm/Associations/Discovery.php @@ -10,6 +10,4 @@ * @method Schema\Discovery schema() * @method V4\Discovery v4() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Associations/Schema/Discovery.php b/lib/Discovery/Crm/Associations/Schema/Discovery.php index eb6dc2382..bc9ad937d 100644 --- a/lib/Discovery/Crm/Associations/Schema/Discovery.php +++ b/lib/Discovery/Crm/Associations/Schema/Discovery.php @@ -8,6 +8,4 @@ /** * @method TypesApi typesApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Associations/V4/Discovery.php b/lib/Discovery/Crm/Associations/V4/Discovery.php index 80e7be0cc..5e54e732a 100644 --- a/lib/Discovery/Crm/Associations/V4/Discovery.php +++ b/lib/Discovery/Crm/Associations/V4/Discovery.php @@ -11,6 +11,4 @@ * @method BatchApi batchApi() * @method Schema\Discovery schema() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Associations/V4/Schema/Discovery.php b/lib/Discovery/Crm/Associations/V4/Schema/Discovery.php index abc5f2d66..241024cc9 100644 --- a/lib/Discovery/Crm/Associations/V4/Schema/Discovery.php +++ b/lib/Discovery/Crm/Associations/V4/Schema/Discovery.php @@ -8,6 +8,4 @@ /** * @method DefinitionsApi definitionsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Companies/Discovery.php b/lib/Discovery/Crm/Companies/Discovery.php index 55a6be82c..fe4109299 100644 --- a/lib/Discovery/Crm/Companies/Discovery.php +++ b/lib/Discovery/Crm/Companies/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Deals/Discovery.php b/lib/Discovery/Crm/Deals/Discovery.php index bb0208601..b25fcc06e 100644 --- a/lib/Discovery/Crm/Deals/Discovery.php +++ b/lib/Discovery/Crm/Deals/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Extensions/Accounting/Discovery.php b/lib/Discovery/Crm/Extensions/Accounting/Discovery.php index 1f30d2068..ac0ac8174 100644 --- a/lib/Discovery/Crm/Extensions/Accounting/Discovery.php +++ b/lib/Discovery/Crm/Extensions/Accounting/Discovery.php @@ -18,6 +18,4 @@ * * @deprecated */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Extensions/Calling/Discovery.php b/lib/Discovery/Crm/Extensions/Calling/Discovery.php index d3ec1234a..ec5c142de 100644 --- a/lib/Discovery/Crm/Extensions/Calling/Discovery.php +++ b/lib/Discovery/Crm/Extensions/Calling/Discovery.php @@ -8,6 +8,4 @@ /** * @method SettingsApi settingsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Extensions/Cards/Discovery.php b/lib/Discovery/Crm/Extensions/Cards/Discovery.php index d4a8ed573..5ae0bb8e1 100644 --- a/lib/Discovery/Crm/Extensions/Cards/Discovery.php +++ b/lib/Discovery/Crm/Extensions/Cards/Discovery.php @@ -10,6 +10,4 @@ * @method CardsApi cardsApi() * @method SampleResponseApi sampleResponseApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Extensions/Discovery.php b/lib/Discovery/Crm/Extensions/Discovery.php index f6ddce56f..19e06bd84 100644 --- a/lib/Discovery/Crm/Extensions/Discovery.php +++ b/lib/Discovery/Crm/Extensions/Discovery.php @@ -10,6 +10,4 @@ * @method Cards\Discovery cards() * @method Videoconferencing\Discovery videoconferencing() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Extensions/Videoconferencing/Discovery.php b/lib/Discovery/Crm/Extensions/Videoconferencing/Discovery.php index 52072b739..ece2de1bc 100644 --- a/lib/Discovery/Crm/Extensions/Videoconferencing/Discovery.php +++ b/lib/Discovery/Crm/Extensions/Videoconferencing/Discovery.php @@ -8,6 +8,4 @@ /** * @method SettingsApi settingsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Imports/Discovery.php b/lib/Discovery/Crm/Imports/Discovery.php index 29c542698..919c91286 100644 --- a/lib/Discovery/Crm/Imports/Discovery.php +++ b/lib/Discovery/Crm/Imports/Discovery.php @@ -10,6 +10,4 @@ * @method CoreApi coreApi() * @method PublicImportsApi publicImportsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/LineItems/Discovery.php b/lib/Discovery/Crm/LineItems/Discovery.php index 5b90106aa..20707451a 100644 --- a/lib/Discovery/Crm/LineItems/Discovery.php +++ b/lib/Discovery/Crm/LineItems/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Objects/Calls/Discovery.php b/lib/Discovery/Crm/Objects/Calls/Discovery.php index ace3120e1..e4a705a49 100644 --- a/lib/Discovery/Crm/Objects/Calls/Discovery.php +++ b/lib/Discovery/Crm/Objects/Calls/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Communications/Discovery.php b/lib/Discovery/Crm/Objects/Communications/Discovery.php index c3303c92a..a887579a6 100644 --- a/lib/Discovery/Crm/Objects/Communications/Discovery.php +++ b/lib/Discovery/Crm/Objects/Communications/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Emails/Discovery.php b/lib/Discovery/Crm/Objects/Emails/Discovery.php index c89ebff55..a8066fae2 100644 --- a/lib/Discovery/Crm/Objects/Emails/Discovery.php +++ b/lib/Discovery/Crm/Objects/Emails/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/FeedbackSubmissions/Discovery.php b/lib/Discovery/Crm/Objects/FeedbackSubmissions/Discovery.php index facf3e9e9..3e71b9d36 100644 --- a/lib/Discovery/Crm/Objects/FeedbackSubmissions/Discovery.php +++ b/lib/Discovery/Crm/Objects/FeedbackSubmissions/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Meetings/Discovery.php b/lib/Discovery/Crm/Objects/Meetings/Discovery.php index 224056e90..35700d73e 100644 --- a/lib/Discovery/Crm/Objects/Meetings/Discovery.php +++ b/lib/Discovery/Crm/Objects/Meetings/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Notes/Discovery.php b/lib/Discovery/Crm/Objects/Notes/Discovery.php index 78b2a9ddb..9f284713c 100644 --- a/lib/Discovery/Crm/Objects/Notes/Discovery.php +++ b/lib/Discovery/Crm/Objects/Notes/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/PostalMail/Discovery.php b/lib/Discovery/Crm/Objects/PostalMail/Discovery.php index 0e1d07364..cca913640 100644 --- a/lib/Discovery/Crm/Objects/PostalMail/Discovery.php +++ b/lib/Discovery/Crm/Objects/PostalMail/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Tasks/Discovery.php b/lib/Discovery/Crm/Objects/Tasks/Discovery.php index 8202b87d1..992eb596f 100644 --- a/lib/Discovery/Crm/Objects/Tasks/Discovery.php +++ b/lib/Discovery/Crm/Objects/Tasks/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Pipelines/Discovery.php b/lib/Discovery/Crm/Pipelines/Discovery.php index 39b76801e..c2d809a22 100644 --- a/lib/Discovery/Crm/Pipelines/Discovery.php +++ b/lib/Discovery/Crm/Pipelines/Discovery.php @@ -14,6 +14,4 @@ * @method PipelineStageAuditsApi pipelineStageAuditsApi() * @method PipelineStagesApi pipelineStagesApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Products/Discovery.php b/lib/Discovery/Crm/Products/Discovery.php index ca46d2748..3d564dff6 100644 --- a/lib/Discovery/Crm/Products/Discovery.php +++ b/lib/Discovery/Crm/Products/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Properties/Discovery.php b/lib/Discovery/Crm/Properties/Discovery.php index 66b8b3ef6..ba5b95152 100644 --- a/lib/Discovery/Crm/Properties/Discovery.php +++ b/lib/Discovery/Crm/Properties/Discovery.php @@ -12,6 +12,4 @@ * @method CoreApi coreApi() * @method GroupsApi groupsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Quotes/Discovery.php b/lib/Discovery/Crm/Quotes/Discovery.php index d87ccf598..eb88562cb 100644 --- a/lib/Discovery/Crm/Quotes/Discovery.php +++ b/lib/Discovery/Crm/Quotes/Discovery.php @@ -14,6 +14,4 @@ * @method SearchApi searchApi() * @method PublicObjectApi publicObjectApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Schemas/Discovery.php b/lib/Discovery/Crm/Schemas/Discovery.php index f4986b792..69732cec7 100644 --- a/lib/Discovery/Crm/Schemas/Discovery.php +++ b/lib/Discovery/Crm/Schemas/Discovery.php @@ -10,6 +10,4 @@ * @method CoreApi coreApi() * @method PublicObjectSchemasApi publicObjectSchemasApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Tickets/Discovery.php b/lib/Discovery/Crm/Tickets/Discovery.php index 33bdaef26..a8afb8864 100644 --- a/lib/Discovery/Crm/Tickets/Discovery.php +++ b/lib/Discovery/Crm/Tickets/Discovery.php @@ -14,6 +14,4 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Crm/Timeline/Discovery.php b/lib/Discovery/Crm/Timeline/Discovery.php index da5805104..8809f3d29 100644 --- a/lib/Discovery/Crm/Timeline/Discovery.php +++ b/lib/Discovery/Crm/Timeline/Discovery.php @@ -12,6 +12,4 @@ * @method TemplatesApi templatesApi() * @method TokensApi tokensApi() */ -class Discovery extends ObjectDiscovery -{ -} +class Discovery extends ObjectDiscovery {} diff --git a/lib/Discovery/Discovery.php b/lib/Discovery/Discovery.php index 4822cc282..e73897d52 100644 --- a/lib/Discovery/Discovery.php +++ b/lib/Discovery/Discovery.php @@ -21,15 +21,15 @@ class Discovery extends DiscoveryBase { /** * @param $options = [ - * 'method' => string, // Optional. Default value GET - * 'path' => string, // Optional. Default value null - * 'headers' => array, // Optional. - * 'body' => mixed, // Optional. - * 'authType' => enum(none, accessToken, hapikey), // Optional. - * 'baseUrl' => string, // Optional. - * 'qs' => array, // Optional. - * 'defaultJson' => bool, // Optional. - * ] + * 'method' => string, // Optional. Default value GET + * 'path' => string, // Optional. Default value null + * 'headers' => array, // Optional. + * 'body' => mixed, // Optional. + * 'authType' => enum(none, accessToken, hapikey), // Optional. + * 'baseUrl' => string, // Optional. + * 'qs' => array, // Optional. + * 'defaultJson' => bool, // Optional. + * ] */ public function apiRequest(array $options = []) { diff --git a/lib/Discovery/DiscoveryBase.php b/lib/Discovery/DiscoveryBase.php index 571dda7db..b67e50f19 100644 --- a/lib/Discovery/DiscoveryBase.php +++ b/lib/Discovery/DiscoveryBase.php @@ -2,11 +2,8 @@ namespace HubSpot\Discovery; -use Exception; use GuzzleHttp\Client; use HubSpot\Config; -use ReflectionClass; -use ReflectionException; class DiscoveryBase { @@ -26,10 +23,10 @@ public function __construct($client, $config) * @param string $name * @param mixed $args * - * @throws Exception - * @throws ReflectionException - * * @return mixed + * + * @throws \Exception + * @throws \ReflectionException */ public function __call($name, $args) { @@ -37,7 +34,7 @@ public function __call($name, $args) return $this->{$name}(...$args); } - $namespace = (new ReflectionClass(get_class($this)))->getNamespaceName(); + $namespace = (new \ReflectionClass(get_class($this)))->getNamespaceName(); $intermediateDiscoveryClassName = $namespace.'\\'.ucfirst($name).'\\Discovery'; if (class_exists($intermediateDiscoveryClassName)) { @@ -53,6 +50,6 @@ public function __call($name, $args) return new $targetClientClassName($this->client, $config); } - throw new Exception('Unable to discover "'.$name.'" client'); + throw new \Exception('Unable to discover "'.$name.'" client'); } } diff --git a/lib/Discovery/Files/Discovery.php b/lib/Discovery/Files/Discovery.php index 721fccf85..45a32c629 100644 --- a/lib/Discovery/Files/Discovery.php +++ b/lib/Discovery/Files/Discovery.php @@ -10,6 +10,4 @@ * @method FilesApi filesApi() * @method FoldersApi foldersApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Marketing/Discovery.php b/lib/Discovery/Marketing/Discovery.php index 52fbfd562..9bd9c5c08 100644 --- a/lib/Discovery/Marketing/Discovery.php +++ b/lib/Discovery/Marketing/Discovery.php @@ -9,6 +9,4 @@ * @method Forms\Discovery forms() * @method Transactional\Discovery transactional() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Marketing/Events/Discovery.php b/lib/Discovery/Marketing/Events/Discovery.php index 8557f3483..e3572c653 100644 --- a/lib/Discovery/Marketing/Events/Discovery.php +++ b/lib/Discovery/Marketing/Events/Discovery.php @@ -14,6 +14,4 @@ * @method SearchApi searchApi() * @method SettingsExternalApi settingsExternalApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Marketing/Forms/Discovery.php b/lib/Discovery/Marketing/Forms/Discovery.php index fe4177cbb..ee0aaeae5 100644 --- a/lib/Discovery/Marketing/Forms/Discovery.php +++ b/lib/Discovery/Marketing/Forms/Discovery.php @@ -8,6 +8,4 @@ /** * @method FormsApi formsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Marketing/Transactional/Discovery.php b/lib/Discovery/Marketing/Transactional/Discovery.php index c19969481..a3fcca0a9 100644 --- a/lib/Discovery/Marketing/Transactional/Discovery.php +++ b/lib/Discovery/Marketing/Transactional/Discovery.php @@ -10,6 +10,4 @@ * @method PublicSmtpTokensApi publicSmtpTokensApi() * @method SingleSendApi singleSendApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Webhooks/Discovery.php b/lib/Discovery/Webhooks/Discovery.php index 9ae7edddf..d1f922eaf 100644 --- a/lib/Discovery/Webhooks/Discovery.php +++ b/lib/Discovery/Webhooks/Discovery.php @@ -10,6 +10,4 @@ * @method SettingsApi settingsApi() * @method SubscriptionsApi subscriptionsApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/RetryMiddlewareFactory.php b/lib/RetryMiddlewareFactory.php index cfe7c1217..519c47135 100644 --- a/lib/RetryMiddlewareFactory.php +++ b/lib/RetryMiddlewareFactory.php @@ -22,10 +22,6 @@ public static function createRateLimitMiddleware( return static::createMiddlewareByHttpCodes([429], $delayFunction, $maxRetries); } - /** - * @param string $delayType Currently supports constant delay, exponential delay, - * linear delay or null - */ public static function createMiddlewareByHttpCodes( array $codes, callable $delayFunction, @@ -37,10 +33,6 @@ public static function createMiddlewareByHttpCodes( ); } - /** - * @param string $delayType Currently supports constant delay, exponential delay, - * linear delay or null - */ public static function createMiddlewareByHttpCodeRange( int $from, int $to, diff --git a/lib/Utils/Signature.php b/lib/Utils/Signature.php index b3dced04f..00e46f50c 100644 --- a/lib/Utils/Signature.php +++ b/lib/Utils/Signature.php @@ -2,8 +2,6 @@ namespace HubSpot\Utils; -use UnexpectedValueException; - class Signature { /** @@ -16,14 +14,6 @@ class Signature * Validation of Hubspot Signature. * * @param array $options - * @param string $secret['signature'] hubspot signarute - * @param string $secret['secret'] the Secret of your app - * @param string $secret['requestBody'] the request body include the payload of the request as a JSON string - * @param string $secret['httpUri'] the full URL of the incoming request, including the http:// prefix, the path of your endpoint, and any query parameters - * @param string $secret['httpMethod'] the method of the incoming request, such as GET or POST - * @param string $secret['timestamp'] a unix timestamp of the request, provided in the X-HubSpot-Request-Timestamp header (Reject the request if the timestamp is older than 5 minutes) - * @param string $secret['signatureVersion'] signature version (V1, V2 or V3) - * @param bool $secret['checkTimestamp'] check timestamp or not (default value true) */ public static function isValid( array $options @@ -48,11 +38,6 @@ public static function isValid( * * @param string $signatureVersion signature version (V1, V2 or V3) * @param array $options - * @param string $secret['secret'] the Secret of your app - * @param string $secret['requestBody'] the request body include the payload of the request as a JSON string - * @param string $secret['httpUri'] the full URL of the incoming request, including the http:// prefix, the path of your endpoint, and any query parameters - * @param string $secret['httpMethod'] the method of the incoming request, such as GET or POST - * @param string $secret['timestamp'] a unix timestamp of the request, provided in the X-HubSpot-Request-Timestamp header */ public static function getHashedSignature( string $signatureVersion, @@ -75,7 +60,7 @@ public static function getHashedSignature( return base64_encode(hash_hmac('sha256', $sourceString, static::getOptionOrThrow($options, 'secret'), true)); default: - throw new UnexpectedValueException("Not supported signature version: {$signatureVersion}"); + throw new \UnexpectedValueException("Not supported signature version: {$signatureVersion}"); } } @@ -89,6 +74,6 @@ protected static function getOptionOrThrow(array $options, string $name, $defaul return $default; } - throw new UnexpectedValueException("Not provided {$name}"); + throw new \UnexpectedValueException("Not provided {$name}"); } } diff --git a/tests/Unit/Http/RequestTest.php b/tests/Unit/Http/RequestTest.php index bda392ae8..028ea1abb 100644 --- a/tests/Unit/Http/RequestTest.php +++ b/tests/Unit/Http/RequestTest.php @@ -8,6 +8,7 @@ /** * @internal + * * @coversNothing */ class RequestTest extends TestCase diff --git a/tests/Unit/Utils/OAuth2Test.php b/tests/Unit/Utils/OAuth2Test.php index 90d68af55..4e971165f 100644 --- a/tests/Unit/Utils/OAuth2Test.php +++ b/tests/Unit/Utils/OAuth2Test.php @@ -7,6 +7,7 @@ /** * @internal + * * @coversNothing */ class OAuth2Test extends TestCase diff --git a/tests/Unit/Utils/SignatureTest.php b/tests/Unit/Utils/SignatureTest.php index 6685ee291..d25416e7a 100644 --- a/tests/Unit/Utils/SignatureTest.php +++ b/tests/Unit/Utils/SignatureTest.php @@ -5,10 +5,10 @@ use HubSpot\Utils\Signature; use HubSpot\Utils\Timestamp; use PHPUnit\Framework\TestCase; -use UnexpectedValueException; /** * @internal + * * @coversNothing */ class SignatureTest extends TestCase @@ -69,7 +69,7 @@ public static function getOptionsForSignatureV3(int $timestamp = 0): array /** @test */ public function unexpectedValueExceptionVersionTest(): void { - $this->expectException(UnexpectedValueException::class); + $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('Not supported signature version: v4'); Signature::isValid(['signatureVersion' => 'v4']); } @@ -77,7 +77,7 @@ public function unexpectedValueExceptionVersionTest(): void /** @test */ public function unexpectedValueExceptionTimestampTest(): void { - $this->expectException(UnexpectedValueException::class); + $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('Not provided timestamp'); Signature::isValid([ 'signatureVersion' => 'v3', From deaad05507a5f85c2701c613ed768c10b915686a Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 14:53:01 +0300 Subject: [PATCH 2/3] run fixer on prs --- .github/workflows/php-cs-fixer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 80f2008ac..07a4b9145 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -1,6 +1,7 @@ name: php-cs-fixer on: + pull_request: push: branches: - "master" From 70c74057b4d31df2b1c826f2bcf00b2b9e07d629 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 14:57:03 +0300 Subject: [PATCH 3/3] donot run fixer on prs --- .github/workflows/php-cs-fixer.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 07a4b9145..80f2008ac 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -1,7 +1,6 @@ name: php-cs-fixer on: - pull_request: push: branches: - "master"