Skip to content

1.0 #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 147 commits into from
Mar 23, 2023
Merged

1.0 #58

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
37abed0
Bump minimum versions for dependencies; require PHP 7.4 or higher
n7studios Mar 1, 2023
1bd3188
Remove trailing comma
n7studios Mar 1, 2023
43a7f07
Updated .gitignore file to exclude vendor folder and other local files
n7studios Mar 1, 2023
1253f9d
Started work on testing and pull request guides
n7studios Mar 1, 2023
6a6a078
Ignore .phpunit.result.cache
n7studios Mar 1, 2023
b9cf8a7
Fix incorrect PHPUnit configuration
n7studios Mar 1, 2023
d092c79
Make tests compatible with PHPUnit 9.x
n7studios Mar 1, 2023
7df4587
Use .env file for configuration, replacing tests/config.example.php
n7studios Mar 1, 2023
ce53870
Merge pull request #28 from ConvertKit/fix-dependencies
n7studios Mar 2, 2023
556798a
Merge remote-tracking branch 'origin/1.0-beta' into fix-tests
n7studios Mar 2, 2023
16f51f9
Started work on refactoring and improving test coverage
n7studios Mar 2, 2023
b678865
More work on improving test coverage
n7studios Mar 2, 2023
306b6ec
Completed first pass of improved test coverage
n7studios Mar 2, 2023
134772f
Updated .env files
n7studios Mar 2, 2023
ed0ebd9
Started applying coding standards to tests
n7studios Mar 2, 2023
fa34ce8
Just use PSR-12 for coding standards for now
n7studios Mar 2, 2023
d77b521
First pass at GitHub action to automate tests
n7studios Mar 2, 2023
878634d
Update testing guide
n7studios Mar 2, 2023
9ce7380
Query subscibers by email address, instead of using inefficient pagin…
n7studios Mar 3, 2023
ef52956
Implement code from ConvertKit API library for fetching legacy forms …
n7studios Mar 3, 2023
f9445fd
Remove unused depdencies
n7studios Mar 3, 2023
0b7f052
Remove unused .env variables
n7studios Mar 3, 2023
2317d4c
Improved test coverage for get_resource()
n7studios Mar 3, 2023
eab7d04
Add missing CONVERTKIT_API_SEQUENCE_ID in .env files
n7studios Mar 3, 2023
b4e79cc
Apply PSR-12 coding standards to API class
n7studios Mar 3, 2023
e197ec8
Remove blank lines after opening function brace
n7studios Mar 3, 2023
9dc57ff
Updated coding standard rules to favor PSR-12, and import/honor Squiz…
n7studios Mar 3, 2023
2664982
Fix TypeError on type hinting DOMNodeList
n7studios Mar 3, 2023
4cda118
Merge pull request #33 from ConvertKit/coding-standards
n7studios Mar 6, 2023
366a9e7
Merge pull request #32 from ConvertKit/fix-get-resource
n7studios Mar 6, 2023
78262b4
Merge pull request #31 from ConvertKit/fix-get-subscriber-id-performance
n7studios Mar 6, 2023
bc4dfaf
Assert less / greater than or equal to, as two subscribers might be s…
n7studios Mar 6, 2023
3918ecd
Updated testing docs to include using PHP CodeSniffer on code
n7studios Mar 6, 2023
ea8699c
Fix coding standards on tests
n7studios Mar 6, 2023
4aff3b7
Fix typo on tests
n7studios Mar 6, 2023
69523a4
Adds get, post, put and delete function calls
n7studios Mar 6, 2023
2db290b
Move repetitive `api_version` property into `make_request()`
n7studios Mar 6, 2023
9361fa3
Move logging into HTTP verb functions; remove variable initialization…
n7studios Mar 6, 2023
c7f51f3
Replace check_if_subscriber_in_array()
n7studios Mar 6, 2023
cfd5a86
Merge remote-tracking branch 'origin/fix-sort-order-tests' into remov…
n7studios Mar 6, 2023
7d7676b
Remove leading forwardslash on endpoints
n7studios Mar 6, 2023
be25cfe
Merge pull request #37 from ConvertKit/move-api-version-into-make-req…
n7studios Mar 6, 2023
e00000c
Merge pull request #39 from ConvertKit/remove-subscriber-array-check-…
n7studios Mar 7, 2023
2619b1b
Merge pull request #36 from ConvertKit/add-http-verb-functions
n7studios Mar 7, 2023
c971157
Merge pull request #35 from ConvertKit/fix-sort-order-tests
n7studios Mar 7, 2023
c1b61a2
Merge pull request #30 from ConvertKit/fix-tests
n7studios Mar 7, 2023
a0cf994
Merge branch '1.0-beta' into refactor-logging-and-api-calls
n7studios Mar 7, 2023
81ecaea
Add missing user agent
n7studios Mar 7, 2023
9521ed2
Merge pull request #38 from ConvertKit/refactor-logging-and-api-calls
n7studios Mar 7, 2023
59a8b09
Added PHPStan with level 6
n7studios Mar 8, 2023
8ed9585
Coding standards
n7studios Mar 8, 2023
0017306
Use PHPStan level 8
n7studios Mar 8, 2023
2535220
Coding standards
n7studios Mar 8, 2023
c60e6bf
Merge pull request #40 from ConvertKit/phpstan
n7studios Mar 9, 2023
f211633
Added `get_forms()` and `get_landing_pages()` API functions
n7studios Mar 9, 2023
21e85fe
Add `get_form_subscriptions()` API function
n7studios Mar 9, 2023
85e0d53
Merge pull request #42 from ConvertKit/get-form-subscriptions
n7studios Mar 10, 2023
2e76f98
Added missing sequence API calls
n7studios Mar 10, 2023
3f5eff7
Coding standards; assert tag saves in test
n7studios Mar 10, 2023
4cd3ba4
Merge branch '1.0-beta' into get-forms-landing-pages
n7studios Mar 10, 2023
3cc8333
Merge pull request #41 from ConvertKit/get-forms-landing-pages
n7studios Mar 10, 2023
663f84f
Merge branch '1.0-beta' into sequence-functions
n7studios Mar 10, 2023
2d31bdc
Stubbed missing tag functions
n7studios Mar 10, 2023
84e0fe6
Merge pull request #43 from ConvertKit/sequence-functions
n7studios Mar 13, 2023
e70782c
Merge remote-tracking branch 'origin/1.0-beta' into tag-functions
n7studios Mar 13, 2023
d2248c7
Added create_tag() and tests
n7studios Mar 13, 2023
813b3cc
Added tag_subscriber() and tests
n7studios Mar 13, 2023
8827017
Added remove_tag_from_subscriber() and tests
n7studios Mar 13, 2023
71a0264
Added remove_tag_from_subscriber_by_email() and tests
n7studios Mar 13, 2023
aa936a9
Added get_tag_subscriptions() and tests
n7studios Mar 13, 2023
d9b6800
Coding standards
n7studios Mar 13, 2023
b889567
Fix failing test
n7studios Mar 13, 2023
80d80b1
Update .env files
n7studios Mar 13, 2023
45830ea
Started stubbing missing subscriber functions
n7studios Mar 13, 2023
7b086c8
Coding standards
n7studios Mar 13, 2023
799ac86
Added tests
n7studios Mar 13, 2023
9e61ac0
Remove form_unsubscribe() test, as we now have specific unsubscribe()…
n7studios Mar 13, 2023
48e27cc
Added custom field API functions
n7studios Mar 13, 2023
51f24d7
Added tests
n7studios Mar 13, 2023
89f4b88
Added get_purchase() API function and tests
n7studios Mar 13, 2023
ea92379
Add testCreatePurchaseWithMissingData test
n7studios Mar 13, 2023
b3bb9e3
Add missing links to API docs
n7studios Mar 13, 2023
854c727
Add missing API doc links
n7studios Mar 13, 2023
377b8d1
Coding standards
n7studios Mar 13, 2023
15e8a9d
First pass at webhook functions
n7studios Mar 13, 2023
98b010a
Coding standards
n7studios Mar 13, 2023
0261903
Added tests
n7studios Mar 13, 2023
4fea065
Added get_webhook() function and test
n7studios Mar 13, 2023
b9644fc
Remove multiple typehinting for PHP 7.4 compat.
n7studios Mar 13, 2023
9729e6d
Merge pull request #45 from ConvertKit/subscriber-functions
n7studios Mar 14, 2023
774d670
Merge pull request #44 from ConvertKit/tag-functions
n7studios Mar 14, 2023
53e8485
Merge pull request #46 from ConvertKit/custom-field-functions
n7studios Mar 14, 2023
f5c21e9
Merge pull request #47 from ConvertKit/purchase-functions
n7studios Mar 14, 2023
4152e05
Merge remote-tracking branch 'origin/1.0-beta' into webhook-functions
n7studios Mar 14, 2023
3b8a826
Merge pull request #48 from ConvertKit/webhook-functions
n7studios Mar 14, 2023
da558ab
Started work on broadcast API functions
n7studios Mar 15, 2023
eb5d726
Coding standards
n7studios Mar 15, 2023
4ecf6c1
Remove get_webhooks() and associated tests
n7studios Mar 16, 2023
8daf63e
Merge pull request #49 from ConvertKit/remove-get-webhooks
n7studios Mar 17, 2023
ab0c8de
Merge remote-tracking branch 'origin/1.0-beta' into broadcast-functions
n7studios Mar 17, 2023
740ff12
Started work on tests
n7studios Mar 17, 2023
a18c01d
Completed tests
n7studios Mar 17, 2023
db505b5
Coding standard fixes
n7studios Mar 17, 2023
b09f535
Removes `$resources` and `$markup` class properties
n7studios Mar 17, 2023
c009490
Add missing broadcast ID from .env files
n7studios Mar 17, 2023
2f117ec
Remove InvalidArgumentException for checking function argument types,…
n7studios Mar 17, 2023
6182f59
get_subscriber_id(): Check email address is a valid email format
n7studios Mar 17, 2023
cbe3e16
get_resource(): Check URL is a valid URL format
n7studios Mar 17, 2023
522cfb6
Added `add_subscriber_to_form()` function with named arguments
n7studios Mar 20, 2023
5d9cd93
Merge pull request #51 from ConvertKit/broadcast-functions
n7studios Mar 20, 2023
58d16dc
Merge pull request #52 from ConvertKit/remove-storing-resources-in-class
n7studios Mar 20, 2023
fbe13bb
Merge branch '1.0-beta' into remove-invalid-argument-exceptions
n7studios Mar 20, 2023
b6e0d29
Merge pull request #53 from ConvertKit/remove-invalid-argument-except…
n7studios Mar 20, 2023
39cf9c9
Merge branch '1.0-beta' into add-subscriber-to-form
n7studios Mar 20, 2023
8422f0b
Started work on docs
n7studios Mar 20, 2023
5ddcbe2
Updated deployment guide
n7studios Mar 20, 2023
f7f9196
Added issue templates
n7studios Mar 20, 2023
8f6bc68
Added contributing guide
n7studios Mar 20, 2023
fd9e0c0
Updated readme to include installation instructions and requirements,…
n7studios Mar 20, 2023
f696a39
Started API docs
n7studios Mar 21, 2023
760d6a7
Added phpDocumentor generated API docs
n7studios Mar 21, 2023
ae02679
Updated readme to link to docs generated by phpDocumentor
n7studios Mar 21, 2023
3b0a076
Updated guides for deployment, setup and contributing
n7studios Mar 21, 2023
02875e3
Fix doc links, added screenshots
n7studios Mar 21, 2023
5703067
Add releases screenshot; remove WordPress references
n7studios Mar 21, 2023
4747c89
Remove InvalidArgumentException
n7studios Mar 22, 2023
dd2c992
Merge pull request #54 from ConvertKit/add-subscriber-to-form
n7studios Mar 22, 2023
ba74ace
Merge pull request #56 from ConvertKit/1.0-docs
n7studios Mar 22, 2023
58a37eb
Merge remote-tracking branch 'origin/1.0-beta' into phpdocumentor
n7studios Mar 22, 2023
db3bb31
Remove saggre/phpdocumentor-markdown in favor of own phpDocumentor ma…
n7studios Mar 22, 2023
8d786e7
Ignore phpDocumentor ast.dump file for debugging
n7studios Mar 22, 2023
4c696d6
Parameters table: Description: Replace pipe symbol with comma, instea…
n7studios Mar 22, 2023
974c439
Updated instructions for compiling docs
n7studios Mar 22, 2023
8e48007
Fix encoding of single quotation marks in method defaults
n7studios Mar 22, 2023
e0ba571
Experiment with removing macros, header and footer templates
n7studios Mar 22, 2023
10c9cd3
Remove unnecessary spacing in markdown docs
n7studios Mar 22, 2023
2236811
Further improvements to markdown templates for PHP SDK docs
n7studios Mar 22, 2023
7a5bba1
Remove unused macros
n7studios Mar 22, 2023
ff9019f
Fix encoding on method return types
n7studios Mar 22, 2023
1fdae1c
Add newlines between Parameters and Return Value headings
n7studios Mar 22, 2023
37c4624
Escape pipes in tables for better rendering
n7studios Mar 22, 2023
c370af0
Escape pipes in tables for argument types
n7studios Mar 22, 2023
0ebf834
Double escape pipe symbols in tables to ensure output renders correctly
n7studios Mar 22, 2023
dcf9cd1
Merge pull request #55 from ConvertKit/phpdocumentor
n7studios Mar 22, 2023
cb17ad5
Add missing see tags to functions, linking to API docs
n7studios Mar 22, 2023
8c196fb
Merge pull request #57 from ConvertKit/add-see-tags
n7studios Mar 23, 2023
ac00175
Merge branch 'master' into 1.0-beta
n7studios Mar 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.dist.testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_URL="https://app.convertkit.com/landing_pages/470099"
CONVERTKIT_API_LANDING_PAGE_URL="https://cheerful-architect-3237.ck.page/cc5eb21744"
CONVERTKIT_API_LEGACY_LANDING_PAGE_URL="https://app.convertkit.com/landing_pages/470103"
CONVERTKIT_API_SEQUENCE_ID="1030824"
CONVERTKIT_API_TAG_NAME="wordpress"
CONVERTKIT_API_TAG_ID="2744672"
CONVERTKIT_API_SUBSCRIBER_EMAIL="[email protected]"
CONVERTKIT_API_SUBSCRIBER_ID="1579118532"
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONVERTKIT_API_KEY_NO_DATA=
CONVERTKIT_API_SECRET_NO_DATA=
CONVERTKIT_API_KEY=
CONVERTKIT_API_SECRET=
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_URL="https://app.convertkit.com/landing_pages/470099"
CONVERTKIT_API_LANDING_PAGE_URL="https://cheerful-architect-3237.ck.page/cc5eb21744"
CONVERTKIT_API_LEGACY_LANDING_PAGE_URL="https://app.convertkit.com/landing_pages/470103"
CONVERTKIT_API_SEQUENCE_ID="1030824"
CONVERTKIT_API_TAG_NAME="wordpress"
CONVERTKIT_API_TAG_ID="2744672"
CONVERTKIT_API_SUBSCRIBER_EMAIL="[email protected]"
CONVERTKIT_API_SUBSCRIBER_ID="1579118532"
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bug report
description: Create a report to help us improve
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: To Reproduce
description: Steps to reproduce the behavior
placeholder: |
1. Fetch a '...'
2. Update the '....'
3. See error
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: code-snippets
attributes:
label: Code snippets
description: If applicable, add code snippets to help explain your problem.
render: PHP
validations:
required: false
- type: input
id: os
attributes:
label: OS
placeholder: macOS
validations:
required: true
- type: input
id: language-version
attributes:
label: PHP version
placeholder: PHP 8.1
validations:
required: true
- type: input
id: lib-version
attributes:
label: Library version
placeholder: v1.0.0
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: ConvertKit support
url: https://convertkit.com/support/
about: |
Please only file issues here that you believe represent actual bugs or feature requests for the ConvertKit PHP SDK.

If you're having general trouble with your ConvertKit integration, please reach out to support.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature request
description: Suggest an idea for this PHP SDK
labels: ["feature-request"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the feature request here.
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Summary

A brief description of what this PR adds, changes or fixes.

If it is adding functionality, a use case of why this is needed helps determine its suitability.

## Testing

Not sure how to perform testing, or perhaps didn't include a test in this PR? Walk through the following in order for a beginner-friendly guide:
- [Setup](SETUP.md) - setting up your local environment for development and testing
- [Development](DEVELOPMENT.md) - best practices for development
- [Testing](TESTING.md) - how to write and run tests

## Checklist

* [ ] I have [written a test](TESTING.md#writing-a-test) and included it in this PR
* [ ] I have [run all tests](TESTING.md#run-tests) and they pass
* [ ] The code passes when [running the PHP CodeSniffer](TESTING.md#run-php-codesniffer)
* [ ] The code passes when [running PHPStan](TESTING.md#run-phpstan)
* [ ] I have assigned a reviewer or two to review this PR (if you're not sure who to assign, we can do this step for you)
Binary file added .github/docs/coding-standards.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/new-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/phpstan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions .github/phpdoc-template/class.md.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{% block content %}
# {{ node.name }}

{% if node.summary %}{{ node.summary|raw }}{% endif %}
{% if node.description %}{{ node.description|raw }}{% endif %}

* Full name: `{{ node.FullyQualifiedStructuralElementName }}`
{% if node.parent and node.parent is not empty %}* Parent class: {{ macros.mdClassLink(node.parent, macros.mdClassPath(node), node.parent.FullyQualifiedStructuralElementName) }}
{% endif %}
{% if node.final %}* This class is marked as **final** and can't be subclassed
{% endif %}
{% if node.deprecated %}* **Warning:** this class is **deprecated**. This means that this class will likely be removed in a future version.
{% endif %}
{% if node.interfaces is not empty %}
* This class implements:
{% for interface in node.interfaces %}
{% if loop.index0 > 0 %}{{ ', ' }}{% endif %}{{ macros.mdClassLink(interface, macros.mdClassPath(node), interface) }}{% endfor %}

{% endif %}
{% if node.abstract %}* This class is an **Abstract class**
{% endif %}
{% if node.final %}* This class is a **Final class**
{% endif %}

{% if node.tags.see is not empty or node.tags.link is not empty %}
**See Also:**

{% for see in node.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description|raw }}{% endif %}

{% endfor %}
{% for link in node.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description|raw }}{% endif %}

{% endfor %}

{% endif %}{# node.tags.see || node.tags.link #}
{% if node.constants | length > 0 %}
## Constants

| Constant | Visibility | Type | Value |
|:---------|:-----------|:-----|:------|
{% for constant in node.constants %}
|`{{constant.name}}`|{{ constant.visibility | default('*default*') }}|{{constant.type | default(' ')}}|{{constant.value}}|
{% endfor %}
{% endif %}
{% if node.properties | length > 0 %}
## Properties

{% for property in node.properties %}
{% include 'property.md.twig' %}
{% endfor %}
{% endif %}
{% if node.methods|length > 0 %}
## Methods

{% for method in node.methods %}
{% include 'method.md.twig' %}
{% endfor %}
{% endif %}{# if methods #}

{% if node.InheritedMethods|length > 0 %}
## Inherited methods

{% for method in node.InheritedMethods %}
{% include 'method.md.twig' %}
{% endfor %}

{% endif %}{# if InheritedMethods #}

{% endblock %}
50 changes: 50 additions & 0 deletions .github/phpdoc-template/method.md.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
### {{ method.name }}

{{ method.summary | raw }}

{# Method signature #}
```php
{% if method.final %}{{ 'final' ~ ' ' }}{% endif %}{{ method.visibility ~ ' ' }}{%if method.static%}{{ 'static' ~ ' ' }}{% endif %}{{ method.name }}({% for argument in method.arguments %}
{{- argument.type | raw }}
{{- argument.byReference ? '&' }} $
{{- argument.name | raw }}{% if argument.default %} = {{ argument.default | raw }}{% endif %}
{%- if not loop.last %}, {% endif %}
{%- endfor %}): {{ method.response.type | raw }}
```
{% if method.description %}{{ method.description | raw }}{% endif %}
{% if method.static %}* This method is **static**.{% endif %}
{% if method.abstract %}* This method is **abstract**.{% endif %}
{% if method.final %}* This method is **final**.{% endif %}
{% if method.deprecated %}* **Warning:** this method is **deprecated**. This means that this method will likely be removed in a future version.
{% endif %}

{% if method.arguments is not empty %}

**Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
{% for argument in method.arguments %}
| `{{ '$' ~ argument.name }}` | **{{ argument.type ? argument.type | default(' ') | replace({'|': '\\|'}) | raw }}** | {{ argument.description | replace({'|': '\\|'}) | nl2br | replace({"\n": "", "\r": "", "\t": ""}) | raw }} |
{% endfor %}
{% endif %}{# method.arguments is not empty #}
{% if method.response.description and method.response.description is not empty %}

**Return Value:**

{{ method.response.description | raw }}
{% endif %}

{% if method.tags.see is not empty or method.tags.link is not empty %}
**See Also:**

{% for see in method.tags.see %}
* {{ see.reference }} {% if see.description is not empty %}- {{ see.description | raw }}{% endif %}
{% endfor %}
{% for link in method.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description | raw }}{% endif %}
{% endfor %}

{% endif %}{# method.tags.see || method.tags.link #}

---
19 changes: 19 additions & 0 deletions .github/phpdoc-template/property.md.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### {{ property.name }}

{{ property.summary | raw }}

```php
{{ property.visibility ~ ' ' }}{% if property.static %}{{ 'static' ~ ' ' }}{% endif %}{% if property.type and property.type is not empty %}{{ property.type ~ ' ' }}{% endif %}{{ '$' ~ property.name }}
```

{% if property.description %}{{ property.description | raw }}{% endif %}
{% if property.static %}* This property is **static**.{% endif %}
{% if property.deprecated %}* **Warning:** this property is **deprecated**. This means that this property will likely be removed in a future version.{% endif %}
{% if property.tags.see is not empty or property.tags.link is not empty %}
{% for see in property.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description | raw }}{% endif %}
{% endfor %}
{% for link in property.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description | raw }}{% endif %}
{% endfor %}
{% endif %}
14 changes: 14 additions & 0 deletions .github/phpdoc-template/template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<template>
<name>markdown</name>
<author>Sakri Koskimies</author>
<email>[email protected]</email>
<version>0.0.2</version>
<transformations>
<transformation writer="twig" query="indexes.classes" source="class.md.twig"
artifact="classes/{{FullyQualifiedStructuralElementName}}.md"/>
</transformations>
<parameters>
<parameter key="twig-debug">true</parameter>
</parameters>
</template>
77 changes: 77 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Run Tests

# When to run tests.
on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main

jobs:
tests:
# Name.
name: PHP ${{ matrix.php-versions }}

# Virtual Environment to use.
# @see: https://github.com/actions/virtual-environments
runs-on: ubuntu-latest

# Defines PHP Versions matrix to run tests on
strategy:
matrix:
php-versions: [ '7.4', '8.0', '8.1', '8.2' ]

# Steps to install, configure and run tests
steps:
# Checkout (copy) this repository's Plugin to this VM.
- name: Checkout Code
uses: actions/checkout@v3

# Install PHP version
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

# Write any secrets, such as API keys, to the .env.dist.testing file now.
# Make sure your committed .env.dist.testing file ends with a newline.
# The formatting of the contents to include a blank newline is deliberate.
- name: Define GitHub Secrets in .env.dist.testing
uses: DamianReeves/[email protected]
with:
path: .env.dist.testing
contents: |

CONVERTKIT_API_KEY=${{ secrets.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET=${{ secrets.CONVERTKIT_API_SECRET }}
CONVERTKIT_API_KEY_NO_DATA=${{ secrets.CONVERTKIT_API_KEY_NO_DATA }}
CONVERTKIT_API_SECRET_NO_DATA=${{ secrets.CONVERTKIT_API_SECRET_NO_DATA }}
write-mode: append

# Rename .env.dist.testing to .env, so PHPUnit reads it for tests.
- name: Rename .env.dist.testing to .env
run: mv .env.dist.testing .env

# Installs PHPUnit, PHP CodeSniffer and anything else needed to run tests.
- name: Run Composer
run: composer update

# Generate autoloader
- name: Build PHP Autoloader
run: composer dump-autoload

# Run Coding Standards.
- name: Run Coding Standards
run: php vendor/bin/phpcs --standard=phpcs.xml

# Run Coding Standards on Tests.
- name: Run Coding Standards on Tests
run: php vendor/bin/phpcs --standard=phpcs.tests.xml

# Run PHPUnit Tests.
- name: Run PHPUnit Tests
run: vendor/bin/phpunit --verbose --stop-on-failure
Loading