Skip to content

Commit

Permalink
Fixed support for php8.2, added testing action
Browse files Browse the repository at this point in the history
  • Loading branch information
rahal committed Dec 7, 2023
1 parent 52f7523 commit 8a3f617
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: validate and test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['8.0', '8.1' , '8.2' , '8.3']

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: xml

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

- name: Run test suite
run: composer run-script test
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
"ext-dom": "*"
},
"require-dev": {
"nette/tester": "~1.1.0"
"nette/tester": "^2.5"
},
"autoload": {
"classmap": ["src/Schematron.php"]
}
},
"scripts": {
"test": "tester -s tests"
}
}
4 changes: 2 additions & 2 deletions src/Schematron.php
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ class SchematronXPath extends DOMXPath
/**
* ($registerNodeNS is FALSE in opposition to DOMXPath default value)
*/
public function query($expression, DOMNode $context = NULL, $registerNodeNS = FALSE)
public function query($expression, DOMNode $context = NULL, $registerNodeNS = FALSE): mixed
{
return parent::query($expression, $context, $registerNodeNS);
}
Expand All @@ -1009,7 +1009,7 @@ public function query($expression, DOMNode $context = NULL, $registerNodeNS = FA
/**
* ($registerNodeNS is FALSE in opposition to DOMXPath default value)
*/
public function evaluate($expression, DOMNode $context = NULL, $registerNodeNS = FALSE)
public function evaluate($expression, DOMNode $context = NULL, $registerNodeNS = FALSE): mixed
{
return parent::evaluate($expression, $context, $registerNodeNS);
}
Expand Down

0 comments on commit 8a3f617

Please sign in to comment.