Skip to content
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.4']
php-versions: ['8.4', '8.5']
composer-options: ['--ignore-platform-req=php+']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
Expand All @@ -29,3 +29,4 @@ jobs:
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
- name: Run the tests
run: composer run psalm
continue-on-error: ${{ matrix.php-versions == '8.5' }}
2 changes: 1 addition & 1 deletion .github/workflows/autoloader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.4']
php-versions: ['8.4', '8.5']
composer-options: ['--ignore-platform-req=php+']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.4']
php-versions: ['8.4', '8.5']
composer-options: ['--ignore-platform-req=php+']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.4']
php-versions: ['8.4', '8.5']
composer-options: ['--ignore-platform-req=php+']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.4']
php-versions: ['8.4', '8.5']
composer-options: ['--ignore-platform-req=php+']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
Expand Down
6 changes: 0 additions & 6 deletions .phive/phars.xml

This file was deleted.

24 changes: 14 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@
],
"type": "library",
"require": {
"php": "~8.4.0",
"php": "~8.4.0 || ~8.5.0",
"ext-dom": "*",
"ext-libxml": "*",
"ext-xml": "*",
"ext-xsl": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"azjezz/psl": "^3.0",
"azjezz/psl": "^3.0 || ~4.0",
"webmozart/assert": "^1.10"
},
"require-dev": {
"symfony/finder": "^7.1",
"veewee/composer-run-parallel": "^1.0.0",
"vimeo/psalm": "^5.4",
"php-standard-library/psalm-plugin": "^2.2"
"vimeo/psalm": "~6.13",
"php-standard-library/psalm-plugin": "^2.2",
"phpunit/phpunit": "~12.3",
"php-cs-fixer/shim": "~3.88",
"infection/infection": "^0.31"
},
"license": "MIT",
"authors": [
Expand All @@ -47,19 +50,19 @@
"autoload": [
"@php build/bootstrap.php"
],
"cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./tools/php-cs-fixer.phar fix --dry-run",
"cs:fix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./tools/php-cs-fixer.phar fix",
"cs": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run",
"cs:fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix",
"psalm": "./vendor/bin/psalm --no-cache --stats",
"tests": "./tools/phpunit.phar --coverage-text --color",
"tests": "./vendor/bin/phpunit --coverage-text --color",
"stress": [
"Composer\\Config::disableProcessTimeout",
"@php -c stress.ini ./tools/phpunit.phar --configuration phpunit.stress.xml --no-coverage"
"@php -c stress.ini ./vendor/bin/phpunit --configuration phpunit.stress.xml --no-coverage"
],
"testquality": "@parallel coverage infection",
"coverage": "@php ./tools/full-coverage-check.php .phpunit.cache/clover/clover.xml",
"infection": [
"Composer\\Config::disableProcessTimeout",
"./tools/infection.phar --show-mutations -v"
"./vendor/bin/infection --show-mutations -v"
],
"ci": [
"@autoload",
Expand All @@ -69,7 +72,8 @@
},
"config": {
"allow-plugins": {
"veewee/composer-run-parallel": true
"veewee/composer-run-parallel": true,
"infection/extension-installer": true
}
}
}
10 changes: 7 additions & 3 deletions infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
},
"minMsi": 100,
"minCoveredMsi": 100,
"phpUnit": {
"customPath": ".\/tools\/phpunit.phar"
},
"logs": {
"text": ".phpunit.cache/infection.log",
"html": ".phpunit.cache/infection"
},
"mutators": {
"@default": true,
"ReturnRemoval": {
"ignore": [
"VeeWee\\Xml\\Dom\\Traverser\\Visitor\\RemoveNamespaces::onNodeLeave",
"VeeWee\\Xml\\Dom\\Traverser\\Visitor\\SortAttributes::onNodeEnter",
"VeeWee\\Xml\\Reader\\Reader::provide",
]
},
"CastInt": {
"ignore": [
"VeeWee\\Xml\\*Exception::__construct"
Expand Down
4 changes: 3 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/bootstrap.php"
executionOrder="random"
beStrictAboutOutputDuringTests="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="false"
beStrictAboutCoverageMetadata="false"
displayDetailsOnTestsThatTriggerWarnings="true"
failOnWarning="true"
failOnPhpunitWarning="true"
>
<coverage>
<report>
Expand Down
19 changes: 3 additions & 16 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,21 @@
skipChecksOnUnresolvableIncludes="false"
checkForThrowsDocblock="true"
checkForThrowsInGlobalScope="true"
findUnusedCode="false"
ensureOverrideAttribute="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="tests" />
<directory name="vendor" />
<file name="src/bootstrap.php"/>
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MissingConstructor>
<errorLevel type="suppress">
<directory name="tests"/>
</errorLevel>
</MissingConstructor>
<UndefinedClass>
<errorLevel type="suppress">
<directory name="tests"/>
</errorLevel>
</UndefinedClass>
<MissingDependency>
<errorLevel type="suppress">
<directory name="tests"/>
</errorLevel>
</MissingDependency>
<MixedArgumentTypeCoercion>
<errorLevel type="suppress">
<directory name="src/Xml/Encoding/Internal/Encoder/Builder" />
Expand Down
2 changes: 1 addition & 1 deletion src/Xml/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function provide(callable $matcher, ?Signal $signal = null): Generator

yield from stop_on_first_issue(
static function () use ($reader, $signal): bool {
if($signal->stopRequested()) {
if ($signal->stopRequested()) {
return !$reader->close();
}

Expand Down
21 changes: 14 additions & 7 deletions src/Xml/Xslt/Configurator/security_preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@
namespace VeeWee\Xml\Xslt\Configurator;

use Closure;
use XSL_SECPREF_CREATE_DIRECTORY;
use XSL_SECPREF_DEFAULT;
use XSL_SECPREF_NONE;
use XSL_SECPREF_READ_FILE;
use XSL_SECPREF_READ_NETWORK;
use XSL_SECPREF_WRITE_FILE;
use XSL_SECPREF_WRITE_NETWORK;
use XSLTProcessor;

/**
* @see https://www.php.net/manual/en/xsltprocessor.setsecurityprefs.php
*
* @param int-mask<
* \XSL_SECPREF_NONE,
* \XSL_SECPREF_READ_FILE,
* \XSL_SECPREF_WRITE_FILE,
* \XSL_SECPREF_CREATE_DIRECTORY,
* \XSL_SECPREF_READ_NETWORK,
* \XSL_SECPREF_WRITE_NETWORK,
* \XSL_SECPREF_DEFAULT
* XSL_SECPREF_NONE,
* XSL_SECPREF_READ_FILE,
* XSL_SECPREF_WRITE_FILE,
* XSL_SECPREF_CREATE_DIRECTORY,
* XSL_SECPREF_READ_NETWORK,
* XSL_SECPREF_WRITE_NETWORK,
* XSL_SECPREF_DEFAULT
* > $preferences
*
* @return Closure(XSLTProcessor): XSLTProcessor
Expand Down
6 changes: 2 additions & 4 deletions tests/Xml/Dom/Assert/AssertAttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
namespace VeeWee\Tests\Xml\Dom\Assert;

use DOM\Node;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psl\Type\Exception\AssertException;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Assert\assert_attribute;

final class AssertAttributeTest extends TestCase
{
/**
*
* @dataProvider provideTestCases
*/
#[DataProvider('provideTestCases')]
public function test_it_knows_attributes(?Node $node, bool $expected): void
{
if (!$expected) {
Expand Down
6 changes: 2 additions & 4 deletions tests/Xml/Dom/Assert/AssertCDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
namespace VeeWee\Tests\Xml\Dom\Assert;

use DOM\Node;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psl\Type\Exception\AssertException;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Assert\assert_cdata;

final class AssertCDataTest extends TestCase
{
/**
*
* @dataProvider provideTestCases
*/
#[DataProvider('provideTestCases')]
public function test_it_knows_cdata(?Node $node, bool $expected): void
{
if (!$expected) {
Expand Down
6 changes: 2 additions & 4 deletions tests/Xml/Dom/Assert/AssertDocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
namespace VeeWee\Tests\Xml\Dom\Assert;

use DOM\Node;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psl\Type\Exception\AssertException;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Assert\assert_document;

final class AssertDocumentTest extends TestCase
{
/**
*
* @dataProvider provideTestCases
*/
#[DataProvider('provideTestCases')]
public function test_it_knows_documents(?Node $node, bool $expected): void
{
if (!$expected) {
Expand Down
6 changes: 2 additions & 4 deletions tests/Xml/Dom/Assert/AssertElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
namespace VeeWee\Tests\Xml\Dom\Assert;

use DOM\Node;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psl\Type\Exception\AssertException;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Assert\assert_element;

final class AssertElementTest extends TestCase
{
/**
*
* @dataProvider provideTestCases
*/
#[DataProvider('provideTestCases')]
public function test_it_knows_elements(?Node $node, bool $expected): void
{
if (!$expected) {
Expand Down
5 changes: 2 additions & 3 deletions tests/Xml/Dom/Configurator/CanonicalizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace VeeWee\Tests\Xml\Dom\Configurator;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Configurator\canonicalize;
Expand All @@ -12,9 +13,7 @@

final class CanonicalizeTest extends TestCase
{
/**
* @dataProvider provideXmls
*/
#[DataProvider('provideXmls')]
public function test_it_can_canonicalize(string $input, string $expected): void
{
$canonicalized = Document::fromXmlString($input, canonicalize());
Expand Down
5 changes: 2 additions & 3 deletions tests/Xml/Dom/Configurator/ComparableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace VeeWee\Tests\Xml\Dom\Configurator;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Configurator\comparable;
Expand All @@ -12,9 +13,7 @@

final class ComparableTest extends TestCase
{
/**
* @dataProvider provideXmls
*/
#[DataProvider('provideXmls')]
public function test_it_can_canonicalize(string $input, string $expected): void
{
$comparable = Document::fromXmlString($input, comparable());
Expand Down
5 changes: 2 additions & 3 deletions tests/Xml/Dom/Configurator/FormatOutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace VeeWee\Tests\Xml\Dom\Configurator;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Configurator\format_output;
Expand All @@ -12,9 +13,7 @@

final class FormatOutputTest extends TestCase
{
/**
* @dataProvider provideFormatOutputCases
*/
#[DataProvider('provideFormatOutputCases')]
public function test_it_can_trim_contents(
?bool $formatOutput,
string $input,
Expand Down
5 changes: 2 additions & 3 deletions tests/Xml/Dom/Configurator/OptimizeNamespacesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace VeeWee\Tests\Xml\Dom\Configurator;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use VeeWee\Xml\Dom\Document;
use function VeeWee\Xml\Dom\Configurator\optimize_namespaces;
Expand All @@ -12,9 +13,7 @@

final class OptimizeNamespacesTest extends TestCase
{
/**
* @dataProvider provideXmls
*/
#[DataProvider('provideXmls')]
public function test_it_can_optimize_namespaces(string $input, string $expected): void
{
$optimized = Document::fromXmlString($input, optimize_namespaces('ns'));
Expand Down
Loading
Loading