diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..910b172 --- /dev/null +++ b/.github/workflows/php.yml @@ -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 diff --git a/composer.json b/composer.json index deaa659..b47675b 100644 --- a/composer.json +++ b/composer.json @@ -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" + } } diff --git a/src/Schematron.php b/src/Schematron.php index d4a725c..bda38f1 100644 --- a/src/Schematron.php +++ b/src/Schematron.php @@ -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); } @@ -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); }