Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 8289f46

Browse files
committed
v1.0.0
Signed-off-by: Finbarrs Oketunji <f@finbarrs.eu>
0 parents  commit 8289f46

23 files changed

+860
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
charset = utf-8
12+
13+
[*.{json,yml}]
14+
indent_size = 2
15+
16+
[*.neon]
17+
indent_style = tab
18+
19+
[Makefile]
20+
indent_style = tab

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
2+
3+
# A list of files and folders those will be excluded from archives and the
4+
# Composer package (for purposes of making it smaller).
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.vscode export-ignore
8+
/examples export-ignore
9+
/phpunit.xml export-ignore
10+
/phpunit.no_autoload.xml export-ignore
11+
/tests export-ignore
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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: currensees-php v1.100.0
62+
validations:
63+
required: true
64+
- type: input
65+
id: api-changelog
66+
attributes:
67+
label: API Changelog
68+
description: See [Changelog](https://docs.currensees.com/#api-changelog) in the API Reference to find which changelog you're using
69+
placeholder: "2020-08-27"
70+
validations:
71+
required: true
72+
- type: textarea
73+
id: additional-context
74+
attributes:
75+
label: Additional context
76+
description: Add any other context about the problem here.
77+
validations:
78+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Moat Systems support
4+
url: https://moatsystems.com/contact/
5+
about: |
6+
Please only file issues here that you believe represent actual bugs or feature requests for the Currency API PHP Library.
7+
If you're having general trouble with your Currency API 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 library
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/workflows/ci.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta
8+
- sdk-release/**
9+
- feature/**
10+
pull_request:
11+
branches:
12+
- main
13+
- beta
14+
- sdk-release/**
15+
- feature/**
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
jobs:
21+
php-cs-fixer:
22+
name: PHP-CS-Fixer
23+
runs-on: ${{ matrix.operating-system }}
24+
strategy:
25+
matrix:
26+
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
27+
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
28+
phpunit-versions: ['latest']
29+
include:
30+
- operating-system: 'ubuntu-latest'
31+
php-versions: '7.2'
32+
phpunit-versions: '8.5.21'
33+
steps:
34+
- uses: actions/checkout@master
35+
- name: PHP-CS-Fixer
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
args: --format=txt --diff --dry-run --using-cache=no --verbose .
39+
phpstan:
40+
name: PHPStan
41+
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
php-version:
46+
- "7.1"
47+
- "7.2"
48+
- "7.3"
49+
- "7.4"
50+
- "8.0"
51+
- "8.1"
52+
steps:
53+
- uses: actions/checkout@master
54+
- name: Setup PHP
55+
uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: ${{ matrix.php-version }}
58+
- name: Get Composer Cache Directory
59+
id: composer-cache
60+
run: |
61+
echo "::set-output name=dir::$(composer config cache-files-dir)"
62+
- uses: actions/cache@v2
63+
with:
64+
path: ${{ steps.composer-cache.outputs.dir }}
65+
# Conventionally you would hash "composer.lock", but we don't commit
66+
# that, so we hash on "composer.json" instead.
67+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
68+
# We run php-cs-fixer in a separate job, but the version we use is not compatible
69+
# with all the versions of PHP that we want to execute PHPStan upon
70+
- name: Trim dependency
71+
run: composer remove --dev friendsofphp/php-cs-fixer
72+
- name: Validate composer.json and composer.lock
73+
run: composer validate
74+
- name: Install dependencies
75+
run: composer install --prefer-dist --no-progress --no-suggest
76+
- name: Run phpstan
77+
run: vendor/bin/phpstan analyse src
78+
tests:
79+
name: Tests
80+
runs-on: ubuntu-latest
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
env:
85+
- AUTOLOAD=0
86+
- AUTOLOAD=1
87+
php-version:
88+
- "7.1"
89+
- "7.2"
90+
- "7.3"
91+
- "7.4"
92+
- "8.0"
93+
- "8.1"
94+
steps:
95+
- uses: actions/checkout@master
96+
- name: Setup PHP
97+
uses: shivammathur/setup-php@v2
98+
with:
99+
php-version: ${{ matrix.php-version }}
100+
coverage: xdebug
101+
- name: Get Composer Cache Directory
102+
id: composer-cache
103+
run: |
104+
echo "::set-output name=dir::$(composer config cache-files-dir)"
105+
- uses: actions/cache@v2
106+
with:
107+
path: ${{ steps.composer-cache.outputs.dir }}
108+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
109+
# We run php-cs-fixer and PHPStan in separate jobs, but the versions we use are not compatible
110+
# with all the versions of PHP that we want to execute PHPUnit upon
111+
- name: Trim dependency
112+
run: composer remove --dev friendsofphp/php-cs-fixer phpstan/phpstan
113+
- name: Validate composer.json and composer.lock
114+
run: composer validate
115+
- name: Install dependencies
116+
run: composer install --prefer-dist --no-progress --no-suggest
117+
- name: Change build.php permissions
118+
run: chmod +x ./build.php
119+
- name: Run test suite
120+
run: |
121+
php --version
122+
./build.php $env:AUTOLOAD

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Composer
2+
/vendor/
3+
composer.lock
4+
composer.phar
5+
6+
# IDEs
7+
.idea/
8+
.vscode/
9+
*.sublime-project
10+
*.sublime-workspace
11+
12+
# Logs and backups
13+
*.log
14+
*.bak
15+
*.swp
16+
17+
# Config files
18+
.env
19+
.env.*
20+
*.ini
21+
*.conf
22+
23+
# Compiled files
24+
*.phar
25+
*.zip
26+
*.tar
27+
*.gz
28+
29+
# Other
30+
.DS_Store
31+
Thumbs.db

.php-cs-fixer.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->notPath('tests/CurrenseesTest.php');
5+
6+
$config = new PhpCsFixer\Config();
7+
$config->setRiskyAllowed(true);
8+
$config->setRules([
9+
// Rulesets
10+
'@PSR2' => true,
11+
'@PhpCsFixer' => true,
12+
'@PhpCsFixer:risky' => true,
13+
'@PHP56Migration:risky' => true,
14+
'@PHPUnit57Migration:risky' => true,
15+
16+
// Additional rules
17+
'fopen_flags' => true,
18+
'linebreak_after_opening_tag' => true,
19+
// This one is non-deterministic based on what environment you are running it in and what `get_defined_constants` returns.
20+
'native_constant_invocation' => false,
21+
'native_function_invocation' => [
22+
"strict" => false,
23+
],
24+
25+
// --- Diffs from @PhpCsFixer / @PhpCsFixer:risky ---
26+
27+
// This is the same as the default for the @PhpCsFixer ruleset, minus
28+
// the following values: ['include', 'include_once', 'require',
29+
// 'require_once']. We could enable them and remove this line after
30+
// updating codegen for the `init.php` file to be compliant.
31+
'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'return', 'switch', 'throw', 'try']],
32+
33+
// This is just prettier / easier to read.
34+
'concat_space' => ['spacing' => 'one'],
35+
36+
// This causes strange ordering with codegen'd classes. We might be
37+
// able to enable this if we update codegen to output class elements
38+
// in the correct order.
39+
'ordered_class_elements' => false,
40+
41+
// Keep this disabled to avoid unnecessary diffs in PHPDoc comments of
42+
// codegen'd classes.
43+
'phpdoc_align' => false,
44+
45+
// This is a "risky" rule that causes a bug in our codebase.
46+
'self_accessor' => false,
47+
48+
// Visibility annotations are not supported by php5.6
49+
'visibility_required' => false,
50+
51+
// Apparently "uninitialized" is distinct from "null" in some versions of PHP
52+
// so I am defensively disabling this rule so as to not cause breaking changes
53+
// but we can feel free to remove it in a major version (or maybe in a minor if
54+
// we devote some effort into determining that it is safe)
55+
'no_null_property_initialization' => false,
56+
57+
// We have to support `@return void` to satisfy Symfony deprecations helper.
58+
'phpdoc_no_empty_return' => false,
59+
]);
60+
$config->setFinder($finder);
61+
return $config;

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@0xnu
2+
@moatsystems

0 commit comments

Comments
 (0)