Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
allow:
- dependency-type: "direct"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "deps"
11 changes: 0 additions & 11 deletions .github/netlicensing-php-dependabot.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/netlicensing-php-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: PHP Client - Demo Test

on:
push:
branches:
- master
- feature/**
pull_request:
branches:
- master
- feature/**
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']

steps:
- uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2

- name: Validate composer manifests
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run PHPUnit
run: vendor/bin/phpunit --testsuite "Application Test Suite"

- name: Run demo scenario (latest PHP)
if: matrix.php-version == '8.4'
run: |
cd demo
php NetLicensingDemo.php
34 changes: 34 additions & 0 deletions .github/workflows/netlicensing-php-dependency-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHP Client - Dependency Test

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
dependency-check:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: ['8.4']

steps:
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Bootstrap temporary project
run: |
composer create-project --no-interaction --prefer-dist composer/semver netlicensing-php-dependency

- name: Require NetLicensing client
working-directory: netlicensing-php-dependency
run: |
composer require --no-interaction labs64/netlicensingclient-php
composer show labs64/netlicensingclient-php
20 changes: 0 additions & 20 deletions .github/workflows/netlicensing-php-dependency.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/php.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Thumbs.db
.buildpath
.project
.settings*
.phpunit.cache
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ composer require labs64/netlicensingclient-php
```
{
"require": {
"labs64/netlicensingclient-php": "^2.5.0"
"labs64/netlicensingclient-php": "^2.6.0"
}
}
```
Expand All @@ -46,6 +46,6 @@ Labs64 NetLicensing Client (PHP) is licensed under the Apache License, Version 2
Visit Labs64 NetLicensing at https://netlicensing.io

[Labs64 NetLicensing]: https://netlicensing.io
[RESTful API]: http://l64.cc/nl10
[RESTful API]: https://netlicensing.io/wiki/restful-api
[GitHub project]: https://github.com/Labs64/NetLicensingClient-php
[PSR-2 Coding Standard]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
2 changes: 1 addition & 1 deletion common/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Constants
{
const NETLICENSING_VERSION = '2.5.0';
const NETLICENSING_VERSION = '2.6.0';

const NUMBER = 'number';
const CASCADE = 'forceCascade';
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
"docs": "https://netlicensing.io/wiki/"
},
"require": {
"php": ">=7.4",
"php": ">=8.2",
"php-curl-class/php-curl-class": "^11.0.0",
"fr3d/xmldsig": "^3.0",
"ext-mbstring": "*",
"ext-json": "*",
"ext-dom": "*"
},
"require-dev": {
"phpunit/phpunit": "~6.5.14",
"fzaninotto/faker": "^v1.9.2",
"wp-cli/php-cli-tools": "^v0.11.11"
"phpunit/phpunit": "^10.5",
"fakerphp/faker": "^1.23",
"wp-cli/php-cli-tools": "^0.12"
},
"autoload": {
"files": [
Expand Down
8 changes: 4 additions & 4 deletions demo/NetLicensingDemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ public function createLicense()
$license->setStartDate('now');
$license->setActive(true);

$this->license = LicenseService::create($this->context, $this->licensee->getNumber(), $this->licenseeTemplate->getNumber(), null, $license);
$this->license = LicenseService::create($this->context, $this->licensee->getNumber(), $this->licenseeTemplate->getNumber(), $license);

//output
$headers = ['Number', 'Name'];
Expand Down Expand Up @@ -941,7 +941,7 @@ public function updateLicense()

$this->license->setName($this->faker->sentence(6, true));

$this->license = LicenseService::update($this->context, $this->license->getNumber(), null, $this->license);
$this->license = LicenseService::update($this->context, $this->license->getNumber(), $this->license);

//output
$headers = ['Number', 'Name'];
Expand Down Expand Up @@ -1263,9 +1263,9 @@ private function error($apiMethod, Exception $exception)
exit();
}

private function table(array $headers, array $rows = null)
private function table(array $headers, ?array $rows = null)
{
$table = new Table($headers, $rows, null);
$table = new Table($headers, $rows ?? []);

$table->display();
}
Expand Down
2 changes: 1 addition & 1 deletion entity/BaseEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function __get(string $key)
* @param mixed $value
* @return void
*/
public function __set(string $key, $value)
public function __set(string $key, mixed $value): void
{
$this->setProperty($key, $value);
}
Expand Down
2 changes: 1 addition & 1 deletion entity/LicenseTransactionJoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LicenseTransactionJoin

protected ?License $license = null;

public function __construct(Transaction $transaction = null, License $license = null)
public function __construct(?Transaction $transaction = null, ?License $license = null)
{
$this->transaction = $transaction;
$this->license = $license;
Expand Down
Loading
Loading