Skip to content

Commit c51917c

Browse files
authored
Merge pull request #15 from gaalferov/2.0-release
2.0 release
2 parents c2df655 + d3f7dd4 commit c51917c

26 files changed

+387
-362
lines changed

.github/workflows/ci-php-cs-fixer.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PHP Coding Standards
2+
3+
on: [push]
4+
5+
jobs:
6+
phpunit-tests:
7+
name: PHP ${{ matrix.php-version }} Latest
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest ]
12+
php-version: [ '8.0','8.1','8.2' ]
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup PHP
19+
id: setup-php
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php-version }}
23+
extensions: mbstring, intl, curl, json, openssl
24+
25+
- name: Print PHP version
26+
run: echo ${{ steps.setup-php.outputs.php-version }}
27+
28+
- name: Get composer cache directory
29+
id: composer-cache
30+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v3
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: ${{ runner.os }}-composer
38+
39+
- name: Install Composer dependencies
40+
run: composer install --prefer-dist --no-progress
41+
42+
- name: Run phpunit tests
43+
run: composer cs-audit

.github/workflows/ci-phpunit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ ubuntu-latest ]
12-
php-version: [ '5.6','7.0','7.1','7.2','7.3','7.4' ]
12+
php-version: [ '8.0','8.1','8.2' ]
1313

1414
steps:
1515
- name: Checkout

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ Dockerfile
1717
###> other ###
1818
.idea/
1919
.psalm-cache/
20+
.php-cs-fixer.cache
2021
###> other ###

.php-cs-fixer.dist.php

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of PHP CS Fixer.
7+
*
8+
* (c) Fabien Potencier <[email protected]>
9+
* Dariusz Rumiński <[email protected]>
10+
*
11+
* This source file is subject to the MIT license that is bundled
12+
* with this source code in the file LICENSE.
13+
*/
14+
15+
$finder = PhpCsFixer\Finder::create()
16+
->ignoreDotFiles(false)
17+
->ignoreVCSIgnored(true)
18+
->exclude(['dev-tools/phpstan', 'tests/Fixtures'])
19+
->in(__DIR__)
20+
;
21+
22+
$config = new PhpCsFixer\Config();
23+
$config
24+
->setRiskyAllowed(true)
25+
->setRules([
26+
'@PHP74Migration' => true,
27+
'@PHP74Migration:risky' => true,
28+
'@PHPUnit100Migration:risky' => true,
29+
'@PhpCsFixer' => true,
30+
'@PhpCsFixer:risky' => true,
31+
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']], // one should use PHPUnit built-in method instead
32+
'modernize_strpos' => true, // needs PHP 8+ or polyfill
33+
'no_useless_concat_operator' => false,
34+
])
35+
->setFinder($finder)
36+
;
37+
38+
return $config;

.php_cs.dist

-22
This file was deleted.

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.0] - 2023-08-23
2+
3+
- Support PHP 8.0 and above
4+
15
## [1.4] - 2023-08-14
26

37
- Partially updated library and supported PHP versions

README.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
PHP extension for Domain Connect
22
===============
33
![GitHub Actions](https://github.com/gaalferov/ext-domain-connect/actions/workflows/ci-phpunit.yml/badge.svg)
4+
![GitHub Actions](https://github.com/gaalferov/ext-domain-connect/actions/workflows/ci-php-cs-fixer.yml/badge.svg)
45
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1df868212d224c8589005c2e8aee7e45)](https://app.codacy.com/gh/gaalferov/ext-domain-connect/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
56

67
[![PHP version support](https://img.shields.io/packagist/dependency-v/gaalferov/php-ext-domain-connect/php?style=flat)](https://packagist.org/packages/gaalferov/php-ext-domain-connect)
@@ -14,6 +15,9 @@ Library offers Service Provider functionality in Sync mode.
1415
## Specification reference
1516
https://github.com/Domain-Connect/spec/blob/master/Domain%20Connect%20Spec%20Draft.adoc
1617

18+
## DC Templates
19+
https://github.com/Domain-Connect/Templates/tree/master
20+
1721
## Install
1822
```bash
1923
composer require gaalferov/php-ext-domain-connect
@@ -34,13 +38,13 @@ use DomainConnect\Services\TemplateService;
3438

3539
try {
3640
$applyUrl = (new TemplateService())->getTemplateSyncUrl(
37-
'foo.connect.domains',
38-
'exampleservice.domainconnect.org',
39-
'template1',
41+
'domainconnect.org', // domain name
42+
'exampleservice.domainconnect.org', // providerId from the template
43+
'template1', // serviceId from the template
4044
[
4145
'IP' => '132.148.25.185',
4246
'RANDOMTEXT' => 'shm:1531371203:Hello world sync',
43-
'redirect_uri' => 'http://example.com',
47+
'redirect_uri' => 'https://your-client-page.com',
4448
'state' => 'someState'
4549
],
4650
);
@@ -54,7 +58,8 @@ try {
5458

5559
Output:
5660
```text
57-
https://domainconnect.1and1.com/sync/v2/domainTemplates/providers/exampleservice.domainconnect.org/services/template1/apply?domain=connect.domains&host=foo&IP=132.148.25.185&RANDOMTEXT=shm%3A1531371203%3AHello+world+sync&redirect_uri=http%3A%2F%2Fexample.com&state=someState
61+
https://dcc.godaddy.com/manage/v2/domainTemplates/providers/exampleservice.domainconnect.org/services/template1/apply?domain=domainconnect.org&IP=132.148.25.185&RANDOMTEXT=shm%3A1531371203%3AHello+world+sync&redirect_uri=https%3A%2F%2Fyour-client-page.com&state=someState
62+
5863
```
5964

6065
### Sync flow with signed request
@@ -73,13 +78,13 @@ try {
7378
$keyId = '_dck1';
7479

7580
$applyUrl = $templateService->getTemplateSyncUrl(
76-
'foo.connect.domains',
77-
'exampleservice.domainconnect.org',
78-
'template1',
81+
'domainconnect.org', // domain name
82+
'exampleservice.domainconnect.org', // providerId from the template
83+
'template1', // serviceId from the template
7984
[
8085
'IP' => '132.148.25.185',
8186
'RANDOMTEXT' => 'shm:1531371203:Hello world sync',
82-
'redirect_uri' => 'http://example.com',
87+
'redirect_uri' => 'https://your-client-page.com',
8388
'state' => 'someState'
8489
],
8590
$privateKey,
@@ -117,7 +122,7 @@ try {
117122
]);
118123

119124
$applyUrl = $templateService->getTemplateSyncUrl(
120-
'foo.connect.domains',
125+
'domainconnect.org',
121126
'exampleservice.domainconnect.org',
122127
'template1',
123128
[

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
}
1717
},
1818
"require": {
19-
"php": "^5.6 || ^7.0",
19+
"php": "^8.0",
2020
"ext-json": "*",
2121
"ext-openssl": "*",
22-
"guzzlehttp/guzzle": "^6.3",
23-
"layershifter/tld-extract": "^2.0"
22+
"guzzlehttp/guzzle": "^7.0"
2423
},
2524
"require-dev": {
26-
"phpunit/phpunit": "^5"
25+
"phpunit/phpunit": "^9.0",
26+
"friendsofphp/php-cs-fixer": "^3.0"
2727
},
2828
"scripts": {
2929
"tests": "vendor/bin/phpunit",
30-
"cs-audit": "php-cs-fixer fix -v --diff --dry-run",
31-
"cs-fix": "php-cs-fixer fix -v --diff"
30+
"cs-audit": "vendor/bin/php-cs-fixer fix -v --diff --dry-run",
31+
"cs-fix": "vendor/bin/php-cs-fixer fix -v --diff"
3232
}
3333
}

0 commit comments

Comments
 (0)