Skip to content

Commit ba74ace

Browse files
authored
Merge pull request #56 from ConvertKit/1.0-docs
Add Guides and Documentation
2 parents dd2c992 + 5703067 commit ba74ace

File tree

12 files changed

+462
-57
lines changed

12 files changed

+462
-57
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report!
9+
- type: textarea
10+
id: what-happened
11+
attributes:
12+
label: Describe the bug
13+
description: A clear and concise description of what the bug is.
14+
placeholder: Tell us what you see!
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: repro-steps
19+
attributes:
20+
label: To Reproduce
21+
description: Steps to reproduce the behavior
22+
placeholder: |
23+
1. Fetch a '...'
24+
2. Update the '....'
25+
3. See error
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: expected-behavior
30+
attributes:
31+
label: Expected behavior
32+
description: A clear and concise description of what you expected to happen.
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: code-snippets
37+
attributes:
38+
label: Code snippets
39+
description: If applicable, add code snippets to help explain your problem.
40+
render: PHP
41+
validations:
42+
required: false
43+
- type: input
44+
id: os
45+
attributes:
46+
label: OS
47+
placeholder: macOS
48+
validations:
49+
required: true
50+
- type: input
51+
id: language-version
52+
attributes:
53+
label: PHP version
54+
placeholder: PHP 8.1
55+
validations:
56+
required: true
57+
- type: input
58+
id: lib-version
59+
attributes:
60+
label: Library version
61+
placeholder: v1.0.0
62+
validations:
63+
required: true
64+
- type: textarea
65+
id: additional-context
66+
attributes:
67+
label: Additional context
68+
description: Add any other context about the problem here.
69+
validations:
70+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: ConvertKit support
4+
url: https://convertkit.com/support/
5+
about: |
6+
Please only file issues here that you believe represent actual bugs or feature requests for the ConvertKit PHP SDK.
7+
8+
If you're having general trouble with your ConvertKit integration, please reach out to support.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature request
2+
description: Suggest an idea for this PHP SDK
3+
labels: ["feature-request"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this feature request!
9+
- type: textarea
10+
id: problem
11+
attributes:
12+
label: Is your feature request related to a problem? Please describe.
13+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14+
- type: textarea
15+
id: solution
16+
attributes:
17+
label: Describe the solution you'd like
18+
description: A clear and concise description of what you want to happen.
19+
- type: textarea
20+
id: alternatives
21+
attributes:
22+
label: Describe alternatives you've considered
23+
description: A clear and concise description of any alternative solutions or features you've considered.
24+
- type: textarea
25+
id: context
26+
attributes:
27+
label: Additional context
28+
description: Add any other context about the feature request here.

.github/docs/coding-standards.png

108 KB
Loading

.github/docs/new-release.png

180 KB
Loading

.github/docs/phpstan.png

99.4 KB
Loading

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Contributing
2+
3+
Contributions of any kind are welcome! If you've found a bug or have a feature request, please feel free to [open an issue](/issues).
4+
5+
To make changes yourself, follow these steps:
6+
7+
1. Follow the [Setup Guide](SETUP.md) to set up your environment and clone this repository
8+
2. Follow the [Development Guide](DEVELOPMENT.md) to create a branch and make changes
9+
3. Refer to the [Testing Guide](TESTING.md) to write applicable unit tests and submit your pull request.
10+
11+
Thanks!

DEPLOYMENT.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Deployment Guide
2+
3+
This document describes the workflow for deploying a PHP SDK update on GitHub.
4+
5+
## Merge Pull Requests
6+
7+
Merge the approved Pull Request(s) to the `main` branch.
8+
9+
An *approved* Pull Request is when a PR passes all tests **and** has been approved by **one or more** reviewers.
10+
11+
## Update the PHP SDK's Version Number
12+
13+
We follow [Semantic Versioning](https://semver.org/).
14+
15+
- In `src/ConvertKit_API.php`, change the `const VERSION` to the new version number.
16+
17+
## Run phpDocumentor
18+
19+
We use [phpDocumentor](https://www.phpdoc.org/) to automatically generate the [PHP SDK documentation](./docs/classes/ConvertKit_API/ConvertKit_API.md).
20+
21+
In a Terminal window, run the phpDocumentor command to generate documentation in markdown format:
22+
23+
```bash
24+
phpDocumentor --directory=src --target=docs --template="vendor/saggre/phpdocumentor-markdown/themes/markdown"
25+
```
26+
27+
## Commit Changes
28+
29+
Commit the updated files, which should comprise of:
30+
31+
- `src/ConvertKit_API.php`
32+
- `docs/classes/ConvertKit_API/ConvertKit_API.md`
33+
34+
## Create a New Release
35+
36+
[Create a New Release](https://github.com/ConvertKit/convertkitsdk-php/releases/new), completing the following:
37+
38+
- Choose a tag: Click this button and enter the new version number (e.g. `1.0`)
39+
- Release title: The version number (e.g. `1.0`)
40+
- Describe this release: Add a changelog detailing the applicable changes this version introduces, with a link to each PR, using the below template
41+
42+
```
43+
# Deprecations / Notices
44+
45+
- PHP: Minimum supported version is now `7.4`
46+
- `add_tag()` will trigger an `E_USER_NOTICE`, as the method name is misleading, and we prefer methods with named arguments; use `tag_subscribe()` (#44)
47+
- `form_subscribe()` will trigger an `E_USER_NOTICE`, as we prefer methods with named arguments; use `add_subscriber_to_form()` (#54)
48+
- `form_unsubscribe()` will trigger an `E_USER_NOTICE`, as the method name is misleading, and we prefer methods with named arguments; use `unsubscribe()` (#45)
49+
50+
# Features / Additions
51+
52+
- Added User-Agent on API requests (#34)
53+
- Added `get()`, `post()`, `put()` and `delete()` methods (#36)
54+
- Added `get_forms()` and `get_landing_pages()` methods (#41)
55+
- Added `get_form_subscriptions()` method (#42)
56+
- Added Tag methods `get_tags()`, `create_tag()`, `tag_subscriber()`, `remove_tag_from_subscriber()`, `remove_tag_from_subscriber_by_email()` (#44)
57+
- Added Subscriber methods `update_subscriber()`, `unsubscribe()` (#45)
58+
- Added `add_subscriber_to_sequence()` to support name, custom fields and tags (#43)
59+
- Added Custom Field methods `get_custom_fields()`, `add_custom_field()`, `add_custom_fields()`, `update_custom_field()`, `delete_custom_field()` (#46)
60+
- Added Purchase method `get_purchase()` (#47)
61+
- Added Webhook methods `create_webhook()`, `destroy_webhook() (#48)
62+
- Added Broadcast methods `create_broadcast()`, `get_broadcast()`, `get_broadcast_stats()`, `update_broadcast()`, `destroy_broadcast()`
63+
64+
# Fixes / Improvements
65+
66+
- Fixed: Guzzle version set to 6.5 or higher (#20, #26, #27)
67+
- Fixed: `get_subscriber_id()` performance (#21, #22, #29, #39)
68+
- Refactored: fetching legacy forms and landing pages (#32)
69+
- Refactored: using `api_version` property, API calls and logging (#37, #38)
70+
- Removed: Caching of resources and markup in class life cycle (#52)
71+
- Removed: `InvalidArgumentException` where type hints for methods now exist (#43)
72+
73+
# Testing
74+
- Added PHPStan static analysis (#40)
75+
- Added PSR-12 coding standards with some modifications (#33)
76+
- Updated PHPUnit test coverage (#30, #35)
77+
```
78+
79+
Generic changelog items such as `Fix: Various bugfixes` or `Several edge-case bug fixes` should be avoided. They don't tell users (or us, as developers)
80+
what took place in this version.
81+
82+
Each line in the changelog should start with `Added` or `Fix`.
83+
84+
![New Release Screen](/.github/docs/new-release.png?raw=true)
85+
86+
## Publish the Release
87+
88+
When you're happy with the above, click `Publish Release`.
89+
90+
This will then make the release available to developers, who can include it manually or using composer.
91+
92+
The release will also be available to view on the [Releases](https://github.com/ConvertKit/convertkitsdk-php/releases) section of this GitHub repository.

DEVELOPMENT.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Development Guide
2+
3+
This document describes the high level workflow used when working on the ConvertKit PHP SDK.
4+
5+
You're free to use your preferred IDE and Git client.
6+
7+
## Prerequisites
8+
9+
If you haven't yet set up your local development environment with the ConvertKit PHP SDK repository installed, refer to the [Setup Guide](SETUP.md).
10+
11+
## Create a Branch
12+
13+
In your Git client / command line, create a new branch:
14+
- If this is for a new feature that does not have a GitHub Issue number, enter a short descriptive name for the branch, relative to what you're working on
15+
- If this is for a feature/bug that has a GitHub Issue number, enter issue-XXX, replacing XXX with the GitHub issue number
16+
17+
Once done, make sure you've switched to your new branch, and begin making the necessary code additions/changes/deletions.
18+
19+
## Coding Standards
20+
21+
Code must follow [PSR-12 Coding standards](https://www.php-fig.org/psr/psr-12/), which is checked when running tests (more on this below).
22+
23+
## Composer Packages
24+
25+
We use Composer for package management. A package can be added to one of two sections of the `composer.json` file: `require` or `require-dev`.
26+
27+
### "require"
28+
29+
Packages listed in the "require" directive are packages that the PHP SDK needs in order to function for end users.
30+
31+
These packages are included when the PHP SDK release is published.
32+
33+
Typically, packages listed in this section would be libraries that the PHP SDK uses, such as:
34+
- [Guzzle](https://docs.guzzlephp.org/en/stable/): PHP HTTP Client
35+
- [Monolog](https://github.com/Seldaek/monolog): PSR-3 compatible logging client
36+
37+
### "require-dev"
38+
39+
Packages listed in the "require-dev" directive are packages that the PHP SDK **does not** need in order to function for end users.
40+
41+
Typically, packages listed in this section would be internal development tools for testing, such as:
42+
- Coding Standards
43+
- PHPStan
44+
- PHPUnit
45+
46+
## Committing Work
47+
48+
Remember to commit your changes to your branch relatively frequently, with a meaningful, short summary that explains what the change(s) do.
49+
This helps anyone looking at the commit history in the future to find what they might be looking for.
50+
51+
If it's a particularly large commit, be sure to include more information in the commit's description.
52+
53+
## Next Steps
54+
55+
Once you've finished your feature or issue, you must write/amend tests for it. Refer to the [Testing Guide](TESTING.md) for a detailed walkthrough
56+
on how to write a test.

0 commit comments

Comments
 (0)