From 7b6f8a85bcb5a669879cec3bf9b57d9dca9d3cb1 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 30 Sep 2025 12:31:40 +0800 Subject: [PATCH 1/3] Update `convertkit.com` to `kit.com` --- .github/ISSUE_TEMPLATE/config.yml | 8 +-- DEPLOYMENT.md | 4 +- SETUP.md | 2 +- composer.json | 29 ++++++-- src/ConvertKit_API_Traits.php | 108 +++++++++++++++--------------- tests/ConvertKitAPIKeyTest.php | 4 +- tests/ConvertKitAPIOAuthTest.php | 2 +- tests/ConvertKitAPITest.php | 8 +-- 8 files changed, 91 insertions(+), 74 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index c500db9..291ddef 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: - - name: ConvertKit support - url: https://convertkit.com/support/ + - name: Kit support + url: https://kit.com/support/ about: | - Please only file issues here that you believe represent actual bugs or feature requests for the ConvertKit PHP SDK. + Please only file issues here that you believe represent actual bugs or feature requests for the Kit PHP SDK. - If you're having general trouble with your ConvertKit integration, please reach out to support. \ No newline at end of file + If you're having general trouble with your Kit integration, please reach out to support. \ No newline at end of file diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 5322da0..e146865 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -35,7 +35,7 @@ Commit the updated files, which should comprise of: ## Create a New Release -[Create a New Release](https://github.com/ConvertKit/convertkitsdk-php/releases/new), completing the following: +[Create a New Release](https://github.com/kit/convertkitsdk-php/releases/new), completing the following: - Choose a tag: Click this button and enter the new version number (e.g. `1.0`) - Release title: The version number (e.g. `1.0`) @@ -91,4 +91,4 @@ When you're happy with the above, click `Publish Release`. This will then make the release available to developers, who can include it manually or using composer. -The release will also be available to view on the [Releases](https://github.com/ConvertKit/convertkitsdk-php/releases) section of this GitHub repository. \ No newline at end of file +The release will also be available to view on the [Releases](https://github.com/kit/convertkitsdk-php/releases) section of this GitHub repository. \ No newline at end of file diff --git a/SETUP.md b/SETUP.md index b28399a..5a36c4f 100644 --- a/SETUP.md +++ b/SETUP.md @@ -1,6 +1,6 @@ # Setup Guide -This document describes how to setup your development environment, so that it is ready to run, develop and test the ConvertKit PHP SDK. +This document describes how to setup your development environment, so that it is ready to run, develop and test the Kit PHP SDK. Suggestions are provided for the LAMP/LEMP stack and Git client are for those who prefer the UI over a command line and/or are less familiar with PHP, MySQL and Git - but you're free to use your preferred software. diff --git a/composer.json b/composer.json index 30a377e..3a62e0f 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,23 @@ { "name": "convertkit/convertkitapi", - "description": "ConvertKit PHP SDK for the ConvertKit API", + "description": "Kit PHP SDK for the Kit API", "keywords": [ "convertkit", + "kit", "api", - "forms" + "forms", + "tags", + "sequences", + "broadcasts", + "emails", + "subscribers" ], - "homepage": "https://convertkit.com/", + "homepage": "https://developers.kit.com/welcome", "license": "GPLv3", "authors": [ { - "name": "ConvertKit and contributors", - "homepage": "https://github.com/convertkit/convertkitsdk-php/contributors" + "name": "Kit and contributors", + "homepage": "https://github.com/kit/convertkitsdk-php/contributors" } ], "require": { @@ -38,6 +44,17 @@ "minimum-stability": "dev", "prefer-stable": true, "scripts": { - "create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'" + "create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'", + "phpcs": "vendor/bin/phpcs ./ -s -v", + "phpcbf": "vendor/bin/phpcbf ./ -s -v", + "phpcs-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v", + "phpcbf-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v", + "phpstan": "vendor/bin/phpstan analyse --memory-limit=1250M", + "php-coding-standards": "vendor/bin/phpcs ./ -s -v", + "fix-php-coding-standards": "vendor/bin/phpcbf ./ -s -v", + "php-coding-standards-on-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v", + "fix-php-coding-standards-on-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v", + "php-static-analysis": "vendor/bin/phpstan analyse --memory-limit=1250M", + "test": "vendor/bin/phpunit" } } diff --git a/src/ConvertKit_API_Traits.php b/src/ConvertKit_API_Traits.php index 71f2175..6847af7 100644 --- a/src/ConvertKit_API_Traits.php +++ b/src/ConvertKit_API_Traits.php @@ -45,14 +45,14 @@ trait ConvertKit_API_Traits * * @var string */ - protected $oauth_authorize_url = 'https://app.convertkit.com/oauth/authorize'; + protected $oauth_authorize_url = 'https://app.kit.com/oauth/authorize'; /** * OAuth Token URL * * @var string */ - protected $oauth_token_url = 'https://api.convertkit.com/oauth/token'; + protected $oauth_token_url = 'https://api.kit.com/oauth/token'; /** * Version of ConvertKit API @@ -66,13 +66,13 @@ trait ConvertKit_API_Traits * * @var string */ - protected $api_url_base = 'https://api.convertkit.com/'; + protected $api_url_base = 'https://api.kit.com/'; /** * Gets the current account * - * @see https://developers.convertkit.com/v4.html#get-current-account + * @see https://developers.kit.com/v4.html#get-current-account * * @return false|mixed */ @@ -84,7 +84,7 @@ public function get_account() /** * Gets the account's colors * - * @see https://developers.convertkit.com/v4.html#list-colors + * @see https://developers.kit.com/v4.html#list-colors * * @return false|mixed */ @@ -98,7 +98,7 @@ public function get_account_colors() * * @param array $colors Hex colors. * - * @see https://developers.convertkit.com/v4.html#list-colors + * @see https://developers.kit.com/v4.html#list-colors * * @return false|mixed */ @@ -113,7 +113,7 @@ public function update_account_colors(array $colors) /** * Gets the Creator Profile * - * @see https://developers.convertkit.com/v4.html#get-creator-profile + * @see https://developers.kit.com/v4.html#get-creator-profile * * @return false|mixed */ @@ -125,7 +125,7 @@ public function get_creator_profile() /** * Gets email stats * - * @see https://developers.convertkit.com/v4.html#get-email-stats + * @see https://developers.kit.com/v4.html#get-email-stats * * @return false|mixed */ @@ -140,7 +140,7 @@ public function get_email_stats() * @param \DateTime|null $starting Gets stats for time period beginning on this date. Defaults to 90 days ago. * @param \DateTime|null $ending Gets stats for time period ending on this date. Defaults to today. * - * @see https://developers.convertkit.com/v4.html#get-growth-stats + * @see https://developers.kit.com/v4.html#get-growth-stats * * @return false|mixed */ @@ -166,7 +166,7 @@ public function get_growth_stats(\DateTime|null $starting = null, \DateTime|null * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#convertkit-api-forms + * @see https://developers.kit.com/v4.html#convertkit-api-forms * * @return mixed|array */ @@ -203,7 +203,7 @@ public function get_forms( * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#convertkit-api-forms + * @see https://developers.kit.com/v4.html#convertkit-api-forms * * @return mixed|array */ @@ -263,7 +263,7 @@ public function add_subscribers_to_forms(array $forms_subscribers_ids, string $c * @param string $email_address Email Address. * @param string $referrer Referrer. * - * @see https://developers.convertkit.com/v4.html#add-subscriber-to-form-by-email-address + * @see https://developers.kit.com/v4.html#add-subscriber-to-form-by-email-address * * @return false|mixed */ @@ -290,7 +290,7 @@ public function add_subscriber_to_form_by_email(int $form_id, string $email_addr * @param integer $subscriber_id Subscriber ID. * @param string $referrer Referrer URL. * - * @see https://developers.convertkit.com/v4.html#add-subscriber-to-form + * @see https://developers.kit.com/v4.html#add-subscriber-to-form * * @since 2.0.0 * @@ -326,7 +326,7 @@ public function add_subscriber_to_form(int $form_id, int $subscriber_id, string * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-subscribers-for-a-form + * @see https://developers.kit.com/v4.html#list-subscribers-for-a-form * * @return false|mixed */ @@ -382,7 +382,7 @@ public function get_form_subscriptions( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-sequences + * @see https://developers.kit.com/v4.html#list-sequences * * @return false|mixed */ @@ -410,7 +410,7 @@ public function get_sequences( * @param integer $sequence_id Sequence ID. * @param string $email_address Email Address. * - * @see https://developers.convertkit.com/v4.html#add-subscriber-to-sequence-by-email-address + * @see https://developers.kit.com/v4.html#add-subscriber-to-sequence-by-email-address * * @return false|mixed */ @@ -428,7 +428,7 @@ public function add_subscriber_to_sequence_by_email(int $sequence_id, string $em * @param integer $sequence_id Sequence ID. * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.convertkit.com/v4.html#add-subscriber-to-sequence + * @see https://developers.kit.com/v4.html#add-subscriber-to-sequence * * @since 2.0.0 * @@ -453,7 +453,7 @@ public function add_subscriber_to_sequence(int $sequence_id, int $subscriber_id) * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-subscribers-for-a-sequence + * @see https://developers.kit.com/v4.html#list-subscribers-for-a-sequence * * @return false|mixed */ @@ -509,7 +509,7 @@ public function get_sequence_subscriptions( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-tags + * @see https://developers.kit.com/v4.html#list-tags * * @return mixed|array */ @@ -538,7 +538,7 @@ public function get_tags( * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#create-a-tag + * @see https://developers.kit.com/v4.html#create-a-tag * * @return false|mixed */ @@ -558,7 +558,7 @@ public function create_tag(string $tag) * * @since 1.1.0 * - * @see https://developers.convertkit.com/v4.html#bulk-create-tags + * @see https://developers.kit.com/v4.html#bulk-create-tags * * @return false|mixed */ @@ -591,7 +591,7 @@ public function create_tags(array $tags, string $callback_url = '') * @param integer $tag_id Tag ID. * @param string $email_address Email Address. * - * @see https://developers.convertkit.com/v4.html#tag-a-subscriber-by-email-address + * @see https://developers.kit.com/v4.html#tag-a-subscriber-by-email-address * * @return false|mixed */ @@ -609,7 +609,7 @@ public function tag_subscriber_by_email(int $tag_id, string $email_address) * @param integer $tag_id Tag ID. * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.convertkit.com/v4.html#tag-a-subscriber + * @see https://developers.kit.com/v4.html#tag-a-subscriber * * @return false|mixed */ @@ -626,7 +626,7 @@ public function tag_subscriber(int $tag_id, int $subscriber_id) * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#remove-tag-from-subscriber + * @see https://developers.kit.com/v4.html#remove-tag-from-subscriber * * @return false|mixed */ @@ -643,7 +643,7 @@ public function remove_tag_from_subscriber(int $tag_id, int $subscriber_id) * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#remove-tag-from-subscriber-by-email-address + * @see https://developers.kit.com/v4.html#remove-tag-from-subscriber-by-email-address * * @return false|mixed */ @@ -669,7 +669,7 @@ public function remove_tag_from_subscriber_by_email(int $tag_id, string $email_a * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-subscribers-for-a-tag + * @see https://developers.kit.com/v4.html#list-subscribers-for-a-tag * * @return false|mixed */ @@ -727,7 +727,7 @@ public function get_tag_subscriptions( * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#convertkit-api-email-templates + * @see https://developers.kit.com/v4.html#convertkit-api-email-templates * * @return false|mixed */ @@ -768,7 +768,7 @@ public function get_email_templates( * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#list-subscribers + * @see https://developers.kit.com/v4.html#list-subscribers * * @return false|mixed */ @@ -841,7 +841,7 @@ public function get_subscribers( * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#create-a-subscriber + * @see https://developers.kit.com/v4.html#create-a-subscriber * * @return mixed */ @@ -879,7 +879,7 @@ public function create_subscriber( * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#bulk-create-subscribers + * @see https://developers.kit.com/v4.html#bulk-create-subscribers * * @return mixed */ @@ -907,7 +907,7 @@ public function create_subscribers(array $subscribers, string $callback_url = '' * * @throws \InvalidArgumentException If the email address is not a valid email format. * - * @see https://developers.convertkit.com/v4.html#get-a-subscriber + * @see https://developers.kit.com/v4.html#get-a-subscriber * * @return false|integer */ @@ -947,7 +947,7 @@ public function get_subscriber_id(string $email_address) * * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.convertkit.com/v4.html#get-a-subscriber + * @see https://developers.kit.com/v4.html#get-a-subscriber * * @return mixed|integer */ @@ -964,7 +964,7 @@ public function get_subscriber(int $subscriber_id) * @param string $email_address New Email Address. * @param array $fields Updated Custom Fields. * - * @see https://developers.convertkit.com/v4.html#update-a-subscriber + * @see https://developers.kit.com/v4.html#update-a-subscriber * * @return mixed */ @@ -999,7 +999,7 @@ public function update_subscriber( * * @param string $email_address Email Address. * - * @see https://developers.convertkit.com/v4.html#unsubscribe-subscriber + * @see https://developers.kit.com/v4.html#unsubscribe-subscriber * * @return mixed|object */ @@ -1018,7 +1018,7 @@ public function unsubscribe_by_email(string $email_address) * * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.convertkit.com/v4.html#unsubscribe-subscriber + * @see https://developers.kit.com/v4.html#unsubscribe-subscriber * * @return mixed|object */ @@ -1036,7 +1036,7 @@ public function unsubscribe(int $subscriber_id) * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-tags-for-a-subscriber + * @see https://developers.kit.com/v4.html#list-tags-for-a-subscriber * * @return mixed|array */ @@ -1067,7 +1067,7 @@ public function get_subscriber_tags( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.convertkit.com/v4.html#list-broadcasts + * @see https://developers.kit.com/v4.html#list-broadcasts * * @return false|mixed */ @@ -1113,7 +1113,7 @@ public function get_broadcasts( * @param string $preview_text Specify the preview text of the email. * @param array $subscriber_filter Filter subscriber(s) to send the email to. * - * @see https://developers.convertkit.com/v4.html#create-a-broadcast + * @see https://developers.kit.com/v4.html#create-a-broadcast * * @return mixed|object */ @@ -1172,7 +1172,7 @@ public function create_broadcast( * * @param integer $id Broadcast ID. * - * @see https://developers.convertkit.com/v4.html#get-a-broadcast + * @see https://developers.kit.com/v4.html#get-a-broadcast * * @return mixed|object */ @@ -1187,7 +1187,7 @@ public function get_broadcast(int $id) * * @param integer $id Broadcast ID. * - * @see https://developers.convertkit.com/v4.html#get-stats + * @see https://developers.kit.com/v4.html#get-stats * * @return mixed|object */ @@ -1220,7 +1220,7 @@ public function get_broadcast_stats(int $id) * @param string $preview_text Specify the preview text of the email. * @param array $subscriber_filter Filter subscriber(s) to send the email to. * - * @see https://developers.convertkit.com/#create-a-broadcast + * @see https://developers.kit.com/#create-a-broadcast * * @return mixed|object */ @@ -1282,7 +1282,7 @@ public function update_broadcast( * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#delete-a-broadcast + * @see https://developers.kit.com/v4.html#delete-a-broadcast * * @return mixed|object */ @@ -1301,7 +1301,7 @@ public function delete_broadcast(int $id) * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#list-webhooks + * @see https://developers.kit.com/v4.html#list-webhooks * * @return false|mixed */ @@ -1333,7 +1333,7 @@ public function get_webhooks( * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#create-a-webhook + * @see https://developers.kit.com/v4.html#create-a-webhook * * @throws \InvalidArgumentException If the event is not supported. * @@ -1409,7 +1409,7 @@ public function create_webhook(string $url, string $event, string $parameter = ' * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#delete-a-webhook + * @see https://developers.kit.com/v4.html#delete-a-webhook * * @return mixed|object */ @@ -1428,7 +1428,7 @@ public function delete_webhook(int $id) * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#list-custom-fields + * @see https://developers.kit.com/v4.html#list-custom-fields * * @return false|mixed */ @@ -1458,7 +1458,7 @@ public function get_custom_fields( * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#create-a-custom-field + * @see https://developers.kit.com/v4.html#create-a-custom-field * * @return mixed|object */ @@ -1478,7 +1478,7 @@ public function create_custom_field(string $label) * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#bulk-create-custom-fields + * @see https://developers.kit.com/v4.html#bulk-create-custom-fields * * @return mixed|object */ @@ -1513,7 +1513,7 @@ public function create_custom_fields(array $labels, string $callback_url = '') * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#update-a-custom-field + * @see https://developers.kit.com/v4.html#update-a-custom-field * * @return mixed|object */ @@ -1532,7 +1532,7 @@ public function update_custom_field(int $id, string $label) * * @since 1.0.0 * - * @see https://developers.convertkit.com/#destroy-field + * @see https://developers.kit.com/#destroy-field * * @return mixed|object */ @@ -1551,7 +1551,7 @@ public function delete_custom_field(int $id) * * @since 1.0.0 * - * @see https://developers.convertkit.com/v4.html#list-purchases + * @see https://developers.kit.com/v4.html#list-purchases * * @return false|mixed */ @@ -1579,7 +1579,7 @@ public function get_purchases( * * @param integer $purchase_id Purchase ID. * - * @see https://developers.convertkit.com/v4.html#get-a-purchase + * @see https://developers.kit.com/v4.html#get-a-purchase * * @return mixed|object */ @@ -1604,7 +1604,7 @@ public function get_purchase(int $purchase_id) * @param float $total Total. * @param \DateTime|null $transaction_time Transaction date and time. * - * @see https://developers.convertkit.com/v4.html#create-a-purchase + * @see https://developers.kit.com/v4.html#create-a-purchase * * @return mixed|object */ @@ -1666,7 +1666,7 @@ public function create_purchase( * * @since 2.0.0 * - * @see https://developers.convertkit.com/v4.html#convertkit-api-segments + * @see https://developers.kit.com/v4.html#convertkit-api-segments * * @return false|mixed */ diff --git a/tests/ConvertKitAPIKeyTest.php b/tests/ConvertKitAPIKeyTest.php index 6558399..d6f0b0c 100644 --- a/tests/ConvertKitAPIKeyTest.php +++ b/tests/ConvertKitAPIKeyTest.php @@ -494,10 +494,10 @@ public function testCreateSubscribers() $this->expectException(ClientException::class); $subscribers = [ [ - 'email_address' => str_replace('@convertkit.com', '-1@convertkit.com', $this->generateEmailAddress()), + 'email_address' => str_replace('@kit.com', '-1@kit.com', $this->generateEmailAddress()), ], [ - 'email_address' => str_replace('@convertkit.com', '-2@convertkit.com', $this->generateEmailAddress()), + 'email_address' => str_replace('@kit.com', '-2@kit.com', $this->generateEmailAddress()), ], ]; $result = $this->api->create_subscribers($subscribers); diff --git a/tests/ConvertKitAPIOAuthTest.php b/tests/ConvertKitAPIOAuthTest.php index 829d0a7..6a2d9eb 100644 --- a/tests/ConvertKitAPIOAuthTest.php +++ b/tests/ConvertKitAPIOAuthTest.php @@ -267,7 +267,7 @@ public function testGetOAuthURL() // Confirm the OAuth URL returned is correct. $this->assertEquals( $this->api->get_oauth_url($_ENV['CONVERTKIT_OAUTH_REDIRECT_URI']), - 'https://app.convertkit.com/oauth/authorize?' . http_build_query([ + 'https://app.kit.com/oauth/authorize?' . http_build_query([ 'client_id' => $_ENV['CONVERTKIT_OAUTH_CLIENT_ID'], 'redirect_uri' => $_ENV['CONVERTKIT_OAUTH_REDIRECT_URI'], 'response_type' => 'code', diff --git a/tests/ConvertKitAPITest.php b/tests/ConvertKitAPITest.php index 786d85e..82f48c1 100644 --- a/tests/ConvertKitAPITest.php +++ b/tests/ConvertKitAPITest.php @@ -3402,10 +3402,10 @@ public function testCreateSubscribers() { $subscribers = [ [ - 'email_address' => str_replace('@convertkit.com', '-1@convertkit.com', $this->generateEmailAddress()), + 'email_address' => str_replace('@kit.com', '-1@kit.com', $this->generateEmailAddress()), ], [ - 'email_address' => str_replace('@convertkit.com', '-2@convertkit.com', $this->generateEmailAddress()), + 'email_address' => str_replace('@kit.com', '-2@kit.com', $this->generateEmailAddress()), ], ]; $result = $this->api->create_subscribers($subscribers); @@ -3706,7 +3706,7 @@ public function testUnsubscribeByEmail() public function testUnsubscribeByEmailWithNotSubscribedEmailAddress() { $this->expectException(ClientException::class); - $subscriber = $this->api->unsubscribe_by_email('not-subscribed@convertkit.com'); + $subscriber = $this->api->unsubscribe_by_email('not-subscribed@kit.com'); } /** @@ -5071,7 +5071,7 @@ public function testGetResourceInvalidURL() public function testGetResourceInaccessibleURL() { $this->expectException(ClientException::class); - $markup = $this->api->get_resource('https://convertkit.com/a/url/that/does/not/exist'); + $markup = $this->api->get_resource('https://kit.com/a/url/that/does/not/exist'); } /** From d8cbe6792a9628cf3c5401ece4101fd5c3e99077 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 30 Sep 2025 12:32:41 +0800 Subject: [PATCH 2/3] Revert composer commands --- composer.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 3a62e0f..9e82db0 100644 --- a/composer.json +++ b/composer.json @@ -44,17 +44,6 @@ "minimum-stability": "dev", "prefer-stable": true, "scripts": { - "create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'", - "phpcs": "vendor/bin/phpcs ./ -s -v", - "phpcbf": "vendor/bin/phpcbf ./ -s -v", - "phpcs-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v", - "phpcbf-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v", - "phpstan": "vendor/bin/phpstan analyse --memory-limit=1250M", - "php-coding-standards": "vendor/bin/phpcs ./ -s -v", - "fix-php-coding-standards": "vendor/bin/phpcbf ./ -s -v", - "php-coding-standards-on-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v", - "fix-php-coding-standards-on-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v", - "php-static-analysis": "vendor/bin/phpstan analyse --memory-limit=1250M", - "test": "vendor/bin/phpunit" + "create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'" } } From 511b40e3e943065762b4a56f4ed0968a38985675 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 30 Sep 2025 18:12:29 +0800 Subject: [PATCH 3/3] Update method URLs to new API docs --- src/ConvertKit_API_Traits.php | 106 +++++++++++++++++----------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/src/ConvertKit_API_Traits.php b/src/ConvertKit_API_Traits.php index 6847af7..432a7da 100644 --- a/src/ConvertKit_API_Traits.php +++ b/src/ConvertKit_API_Traits.php @@ -72,7 +72,7 @@ trait ConvertKit_API_Traits /** * Gets the current account * - * @see https://developers.kit.com/v4.html#get-current-account + * @see https://developers.kit.com/api-reference/accounts/get-current-account * * @return false|mixed */ @@ -84,7 +84,7 @@ public function get_account() /** * Gets the account's colors * - * @see https://developers.kit.com/v4.html#list-colors + * @see https://developers.kit.com/api-reference/accounts/list-colors * * @return false|mixed */ @@ -94,11 +94,11 @@ public function get_account_colors() } /** - * Gets the account's colors + * Updates the account's colors * * @param array $colors Hex colors. * - * @see https://developers.kit.com/v4.html#list-colors + * @see https://developers.kit.com/api-reference/accounts/update-colors * * @return false|mixed */ @@ -113,7 +113,7 @@ public function update_account_colors(array $colors) /** * Gets the Creator Profile * - * @see https://developers.kit.com/v4.html#get-creator-profile + * @see https://developers.kit.com/api-reference/accounts/get-creator-profile * * @return false|mixed */ @@ -125,7 +125,7 @@ public function get_creator_profile() /** * Gets email stats * - * @see https://developers.kit.com/v4.html#get-email-stats + * @see https://developers.kit.com/api-reference/accounts/get-email-stats * * @return false|mixed */ @@ -140,7 +140,7 @@ public function get_email_stats() * @param \DateTime|null $starting Gets stats for time period beginning on this date. Defaults to 90 days ago. * @param \DateTime|null $ending Gets stats for time period ending on this date. Defaults to today. * - * @see https://developers.kit.com/v4.html#get-growth-stats + * @see https://developers.kit.com/api-reference/accounts/get-growth-stats * * @return false|mixed */ @@ -166,7 +166,7 @@ public function get_growth_stats(\DateTime|null $starting = null, \DateTime|null * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#convertkit-api-forms + * @see https://developers.kit.com/api-reference/forms/list-forms * * @return mixed|array */ @@ -203,7 +203,7 @@ public function get_forms( * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#convertkit-api-forms + * @see https://developers.kit.com/api-reference/forms/list-forms * * @return mixed|array */ @@ -237,7 +237,7 @@ public function get_landing_pages( * * @since 2.1.0 * - * @see https://developers.kit.com/v4.html#bulk-add-subscribers-to-forms + * @see https://developers.kit.com/api-reference/forms/bulk-add-subscribers-to-forms * * @return mixed|object */ @@ -263,7 +263,7 @@ public function add_subscribers_to_forms(array $forms_subscribers_ids, string $c * @param string $email_address Email Address. * @param string $referrer Referrer. * - * @see https://developers.kit.com/v4.html#add-subscriber-to-form-by-email-address + * @see https://developers.kit.com/api-reference/forms/add-subscriber-to-form-by-email-address * * @return false|mixed */ @@ -290,7 +290,7 @@ public function add_subscriber_to_form_by_email(int $form_id, string $email_addr * @param integer $subscriber_id Subscriber ID. * @param string $referrer Referrer URL. * - * @see https://developers.kit.com/v4.html#add-subscriber-to-form + * @see https://developers.kit.com/api-reference/forms/add-subscriber-to-form * * @since 2.0.0 * @@ -326,7 +326,7 @@ public function add_subscriber_to_form(int $form_id, int $subscriber_id, string * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-subscribers-for-a-form + * @see https://developers.kit.com/api-reference/forms/list-subscribers-for-a-form * * @return false|mixed */ @@ -382,7 +382,7 @@ public function get_form_subscriptions( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-sequences + * @see https://developers.kit.com/api-reference/sequences/list-sequences * * @return false|mixed */ @@ -410,7 +410,7 @@ public function get_sequences( * @param integer $sequence_id Sequence ID. * @param string $email_address Email Address. * - * @see https://developers.kit.com/v4.html#add-subscriber-to-sequence-by-email-address + * @see https://developers.kit.com/api-reference/sequences/add-subscriber-to-sequence-by-email-address * * @return false|mixed */ @@ -428,7 +428,7 @@ public function add_subscriber_to_sequence_by_email(int $sequence_id, string $em * @param integer $sequence_id Sequence ID. * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.kit.com/v4.html#add-subscriber-to-sequence + * @see https://developers.kit.com/api-reference/sequences/add-subscriber-to-sequence * * @since 2.0.0 * @@ -453,7 +453,7 @@ public function add_subscriber_to_sequence(int $sequence_id, int $subscriber_id) * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-subscribers-for-a-sequence + * @see https://developers.kit.com/api-reference/sequences/list-subscribers-for-a-sequence * * @return false|mixed */ @@ -509,7 +509,7 @@ public function get_sequence_subscriptions( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-tags + * @see https://developers.kit.com/api-reference/tags/list-tags * * @return mixed|array */ @@ -538,7 +538,7 @@ public function get_tags( * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#create-a-tag + * @see https://developers.kit.com/api-reference/tags/create-a-tag * * @return false|mixed */ @@ -558,7 +558,7 @@ public function create_tag(string $tag) * * @since 1.1.0 * - * @see https://developers.kit.com/v4.html#bulk-create-tags + * @see https://developers.kit.com/api-reference/tags/bulk-create-tags * * @return false|mixed */ @@ -591,7 +591,7 @@ public function create_tags(array $tags, string $callback_url = '') * @param integer $tag_id Tag ID. * @param string $email_address Email Address. * - * @see https://developers.kit.com/v4.html#tag-a-subscriber-by-email-address + * @see https://developers.kit.com/api-reference/tags/tag-a-subscriber-by-email-address * * @return false|mixed */ @@ -609,7 +609,7 @@ public function tag_subscriber_by_email(int $tag_id, string $email_address) * @param integer $tag_id Tag ID. * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.kit.com/v4.html#tag-a-subscriber + * @see https://developers.kit.com/api-reference/tags/tag-a-subscriber * * @return false|mixed */ @@ -626,7 +626,7 @@ public function tag_subscriber(int $tag_id, int $subscriber_id) * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#remove-tag-from-subscriber + * @see https://developers.kit.com/api-reference/tags/remove-tag-from-subscriber * * @return false|mixed */ @@ -643,7 +643,7 @@ public function remove_tag_from_subscriber(int $tag_id, int $subscriber_id) * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#remove-tag-from-subscriber-by-email-address + * @see https://developers.kit.com/api-reference/tags/remove-tag-from-subscriber-by-email-address * * @return false|mixed */ @@ -669,7 +669,7 @@ public function remove_tag_from_subscriber_by_email(int $tag_id, string $email_a * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-subscribers-for-a-tag + * @see https://developers.kit.com/api-reference/tags/list-subscribers-for-a-tag * * @return false|mixed */ @@ -727,7 +727,7 @@ public function get_tag_subscriptions( * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#convertkit-api-email-templates + * @see https://developers.kit.com/api-reference/email-templates/list-email-templates * * @return false|mixed */ @@ -768,7 +768,7 @@ public function get_email_templates( * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#list-subscribers + * @see https://developers.kit.com/api-reference/subscribers/list-subscribers * * @return false|mixed */ @@ -841,7 +841,7 @@ public function get_subscribers( * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#create-a-subscriber + * @see https://developers.kit.com/api-reference/subscribers/create-a-subscriber * * @return mixed */ @@ -879,7 +879,7 @@ public function create_subscriber( * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#bulk-create-subscribers + * @see https://developers.kit.com/api-reference/subscribers/bulk-create-subscribers * * @return mixed */ @@ -907,7 +907,7 @@ public function create_subscribers(array $subscribers, string $callback_url = '' * * @throws \InvalidArgumentException If the email address is not a valid email format. * - * @see https://developers.kit.com/v4.html#get-a-subscriber + * @see https://developers.kit.com/api-reference/subscribers/get-a-subscriber * * @return false|integer */ @@ -947,7 +947,7 @@ public function get_subscriber_id(string $email_address) * * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.kit.com/v4.html#get-a-subscriber + * @see https://developers.kit.com/api-reference/subscribers/get-a-subscriber * * @return mixed|integer */ @@ -964,7 +964,7 @@ public function get_subscriber(int $subscriber_id) * @param string $email_address New Email Address. * @param array $fields Updated Custom Fields. * - * @see https://developers.kit.com/v4.html#update-a-subscriber + * @see https://developers.kit.com/api-reference/subscribers/update-a-subscriber * * @return mixed */ @@ -999,7 +999,7 @@ public function update_subscriber( * * @param string $email_address Email Address. * - * @see https://developers.kit.com/v4.html#unsubscribe-subscriber + * @see https://developers.kit.com/api-reference/subscribers/unsubscribe-subscriber * * @return mixed|object */ @@ -1018,7 +1018,7 @@ public function unsubscribe_by_email(string $email_address) * * @param integer $subscriber_id Subscriber ID. * - * @see https://developers.kit.com/v4.html#unsubscribe-subscriber + * @see https://developers.kit.com/api-reference/subscribers/unsubscribe-subscriber * * @return mixed|object */ @@ -1036,7 +1036,7 @@ public function unsubscribe(int $subscriber_id) * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-tags-for-a-subscriber + * @see https://developers.kit.com/api-reference/subscribers/list-tags-for-a-subscriber * * @return mixed|array */ @@ -1067,7 +1067,7 @@ public function get_subscriber_tags( * @param string $before_cursor Return results before the given pagination cursor. * @param integer $per_page Number of results to return. * - * @see https://developers.kit.com/v4.html#list-broadcasts + * @see https://developers.kit.com/api-reference/broadcasts/list-broadcasts * * @return false|mixed */ @@ -1113,7 +1113,7 @@ public function get_broadcasts( * @param string $preview_text Specify the preview text of the email. * @param array $subscriber_filter Filter subscriber(s) to send the email to. * - * @see https://developers.kit.com/v4.html#create-a-broadcast + * @see https://developers.kit.com/api-reference/broadcasts/create-a-broadcast * * @return mixed|object */ @@ -1172,7 +1172,7 @@ public function create_broadcast( * * @param integer $id Broadcast ID. * - * @see https://developers.kit.com/v4.html#get-a-broadcast + * @see https://developers.kit.com/api-reference/broadcasts/get-a-broadcast * * @return mixed|object */ @@ -1187,7 +1187,7 @@ public function get_broadcast(int $id) * * @param integer $id Broadcast ID. * - * @see https://developers.kit.com/v4.html#get-stats + * @see https://developers.kit.com/api-reference/broadcasts/get-stats-for-a-broadcast * * @return mixed|object */ @@ -1220,7 +1220,7 @@ public function get_broadcast_stats(int $id) * @param string $preview_text Specify the preview text of the email. * @param array $subscriber_filter Filter subscriber(s) to send the email to. * - * @see https://developers.kit.com/#create-a-broadcast + * @see https://developers.kit.com/api-reference/broadcasts/update-a-broadcast * * @return mixed|object */ @@ -1282,7 +1282,7 @@ public function update_broadcast( * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#delete-a-broadcast + * @see https://developers.kit.com/api-reference/broadcasts/delete-a-broadcast * * @return mixed|object */ @@ -1301,7 +1301,7 @@ public function delete_broadcast(int $id) * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#list-webhooks + * @see https://developers.kit.com/api-reference/webhooks/list-webhooks * * @return false|mixed */ @@ -1333,7 +1333,7 @@ public function get_webhooks( * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#create-a-webhook + * @see https://developers.kit.com/api-reference/webhooks/create-a-webhook * * @throws \InvalidArgumentException If the event is not supported. * @@ -1409,7 +1409,7 @@ public function create_webhook(string $url, string $event, string $parameter = ' * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#delete-a-webhook + * @see https://developers.kit.com/api-reference/webhooks/delete-a-webhook * * @return mixed|object */ @@ -1428,7 +1428,7 @@ public function delete_webhook(int $id) * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#list-custom-fields + * @see https://developers.kit.com/api-reference/custom-fields/list-custom-fields * * @return false|mixed */ @@ -1458,7 +1458,7 @@ public function get_custom_fields( * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#create-a-custom-field + * @see https://developers.kit.com/api-reference/custom-fields/create-a-custom-field * * @return mixed|object */ @@ -1478,7 +1478,7 @@ public function create_custom_field(string $label) * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#bulk-create-custom-fields + * @see https://developers.kit.com/api-reference/custom-fields/bulk-create-custom-fields * * @return mixed|object */ @@ -1513,7 +1513,7 @@ public function create_custom_fields(array $labels, string $callback_url = '') * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#update-a-custom-field + * @see https://developers.kit.com/api-reference/custom-fields/update-a-custom-field * * @return mixed|object */ @@ -1532,7 +1532,7 @@ public function update_custom_field(int $id, string $label) * * @since 1.0.0 * - * @see https://developers.kit.com/#destroy-field + * @see https://developers.kit.com/api-reference/custom-fields/delete-custom-field * * @return mixed|object */ @@ -1551,7 +1551,7 @@ public function delete_custom_field(int $id) * * @since 1.0.0 * - * @see https://developers.kit.com/v4.html#list-purchases + * @see https://developers.kit.com/api-reference/purchases/list-purchases * * @return false|mixed */ @@ -1579,7 +1579,7 @@ public function get_purchases( * * @param integer $purchase_id Purchase ID. * - * @see https://developers.kit.com/v4.html#get-a-purchase + * @see https://developers.kit.com/api-reference/purchases/get-a-purchase * * @return mixed|object */ @@ -1604,7 +1604,7 @@ public function get_purchase(int $purchase_id) * @param float $total Total. * @param \DateTime|null $transaction_time Transaction date and time. * - * @see https://developers.kit.com/v4.html#create-a-purchase + * @see https://developers.kit.com/api-reference/purchases/create-a-purchase * * @return mixed|object */ @@ -1666,7 +1666,7 @@ public function create_purchase( * * @since 2.0.0 * - * @see https://developers.kit.com/v4.html#convertkit-api-segments + * @see https://developers.kit.com/api-reference/segments/list-segments * * @return false|mixed */