Skip to content

Commit c2b2ead

Browse files
r-brownCopilotCopilot
authored
Upgrade PHP stack (#7)
* Upgrade NetLicensingClient-php library to support PHP v8.2 and higher * Fix demo * Fix security warnings * Revisit GitHub Actions * Prepare v2.6.0 * Copilot review * Add missing string type hint to TransactionService::get() parameter (#8) * Initial plan * Add string type hint to TransactionService::get() $number parameter Co-authored-by: r-brown <1361258+r-brown@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: r-brown <1361258+r-brown@users.noreply.github.com> * Add string type hint to PaymentMethodService::get() parameter (#9) * Initial plan * Add string type hint to PaymentMethodService::get() $number parameter Co-authored-by: r-brown <1361258+r-brown@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: r-brown <1361258+r-brown@users.noreply.github.com> * Update vo/ValidationParameters.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 84a9910 commit c2b2ead

31 files changed

+188
-166
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
allow:
10+
- dependency-type: "direct"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
commit-message:
16+
prefix: "deps"

.github/netlicensing-php-dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: PHP Client - Demo Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- feature/**
8+
pull_request:
9+
branches:
10+
- master
11+
- feature/**
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
php-version: ['8.2', '8.3', '8.4']
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Setup PHP ${{ matrix.php-version }}
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
coverage: none
33+
tools: composer:v2
34+
35+
- name: Validate composer manifests
36+
run: composer validate --strict
37+
38+
- name: Cache Composer packages
39+
id: composer-cache
40+
uses: actions/cache@v4
41+
with:
42+
path: vendor
43+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-php-${{ matrix.php-version }}-
46+
47+
- name: Install dependencies
48+
run: composer install --prefer-dist --no-progress --no-interaction
49+
50+
- name: Run PHPUnit
51+
run: vendor/bin/phpunit --testsuite "Application Test Suite"
52+
53+
- name: Run demo scenario (latest PHP)
54+
if: matrix.php-version == '8.4'
55+
run: |
56+
cd demo
57+
php NetLicensingDemo.php
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: PHP Client - Dependency Test
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
dependency-check:
13+
runs-on: ubuntu-22.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version: ['8.4']
18+
19+
steps:
20+
- name: Setup PHP ${{ matrix.php-version }}
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
tools: composer:v2
25+
26+
- name: Bootstrap temporary project
27+
run: |
28+
composer create-project --no-interaction --prefer-dist composer/semver netlicensing-php-dependency
29+
30+
- name: Require NetLicensing client
31+
working-directory: netlicensing-php-dependency
32+
run: |
33+
composer require --no-interaction labs64/netlicensingclient-php
34+
composer show labs64/netlicensingclient-php

.github/workflows/netlicensing-php-dependency.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/php.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Thumbs.db
1010
.buildpath
1111
.project
1212
.settings*
13+
.phpunit.cache

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $ composer require labs64/netlicensingclient-php
2424
```
2525
{
2626
"require": {
27-
"labs64/netlicensingclient-php": "^2.5.0"
27+
"labs64/netlicensingclient-php": "^2.6.0"
2828
}
2929
}
3030
```
@@ -46,6 +46,6 @@ Labs64 NetLicensing Client (PHP) is licensed under the Apache License, Version 2
4646
Visit Labs64 NetLicensing at https://netlicensing.io
4747

4848
[Labs64 NetLicensing]: https://netlicensing.io
49-
[RESTful API]: http://l64.cc/nl10
49+
[RESTful API]: https://netlicensing.io/wiki/restful-api
5050
[GitHub project]: https://github.com/Labs64/NetLicensingClient-php
5151
[PSR-2 Coding Standard]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md

common/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class Constants
1313
{
14-
const NETLICENSING_VERSION = '2.5.0';
14+
const NETLICENSING_VERSION = '2.6.0';
1515

1616
const NUMBER = 'number';
1717
const CASCADE = 'forceCascade';

0 commit comments

Comments
 (0)