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
17 changes: 10 additions & 7 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
*
Expand All @@ -14,14 +16,14 @@
use PhpCsFixer\Finder;

$header = <<<'EOF'
This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.

(c) SpacePossum
Dariusz Rumiński <dariusz.ruminski@gmail.com>
(c) SpacePossum
Dariusz Rumiński <dariusz.ruminski@gmail.com>

This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;

$finder = Finder::create()
->exclude('tests/Fixtures')
Expand All @@ -32,9 +34,10 @@
return (new Config())
->setRiskyAllowed(true)
->setRules([
'@auto' => true,
'@auto:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit60Migration:risky' => true,
'header_comment' => ['header' => $header],
])
->setFinder($finder)
Expand Down
8 changes: 4 additions & 4 deletions dev-tools/composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"require": {
"php": "^8.1"
"php": "^8.5"
},
"require-dev": {
"ergebnis/composer-normalize": "*",
"maglnet/composer-require-checker": "^3.8",
"ergebnis/composer-normalize": "^2.50",
"maglnet/composer-require-checker": "^4.21",
"mi-schi/phpmd-extension": "^4.3",
"php-cs-fixer/shim": "^3.68.5",
"php-cs-fixer/shim": "^3.94.2",
"phpmd/phpmd": "^2.15"
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions src/Constraint/XmlMatchesXsd.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
*
Expand All @@ -12,6 +14,4 @@

namespace PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint;

use PHPUnit\Runner\Version;

class_alias(XmlMatchesXsdForV9::class, XmlMatchesXsd::class);
4 changes: 3 additions & 1 deletion src/Constraint/XmlMatchesXsdForV9.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
*
Expand Down Expand Up @@ -110,7 +112,7 @@ private function stringMatches($other)
return $result;
}

private function setXMLConstraintErrors()
private function setXMLConstraintErrors(): void
{
foreach (libxml_get_errors() as $error) {
if (LIBXML_ERR_WARNING === $error->level) {
Expand Down
22 changes: 12 additions & 10 deletions tests/Constraint/XmlMatchesXsdTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
*
Expand All @@ -22,7 +24,7 @@
*/
final class XmlMatchesXsdTest extends TestCase
{
public function testAssertXMLMatchesXSD()
public function testAssertXMLMatchesXSD(): void
{
$constraint = new XmlMatchesXsd($this->getXSD());
$sampleFile = $this->getAssetsDir().'xliff_sample.xml';
Expand All @@ -42,14 +44,14 @@ public function testAssertXMLMatchesXSD()
self::assertTrue($constraint->evaluate($content, '', true));
}

public function testXMLValidConstraintBasics()
public function testXMLValidConstraintBasics(): void
{
$constraint = new XmlMatchesXsd('');
self::assertSame(1, $constraint->count());
self::assertSame('matches XSD', $constraint->toString());
}

public function testXMLValidConstraintFalse()
public function testXMLValidConstraintFalse(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand All @@ -62,7 +64,7 @@ public function testXMLValidConstraintFalse()
$constraint->evaluate(false);
}

public function testXMLValidConstraintInt()
public function testXMLValidConstraintInt(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand All @@ -75,7 +77,7 @@ public function testXMLValidConstraintInt()
$constraint->evaluate(1);
}

public function testXMLValidConstraintInvalidXML()
public function testXMLValidConstraintInvalidXML(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand All @@ -88,7 +90,7 @@ public function testXMLValidConstraintInvalidXML()
$constraint->evaluate('<a></b>');
}

public function testXMLValidConstraintNotMatchingXML()
public function testXMLValidConstraintNotMatchingXML(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand All @@ -101,7 +103,7 @@ public function testXMLValidConstraintNotMatchingXML()
$constraint->evaluate('<a></a>');
}

public function testXMLValidConstraintNull()
public function testXMLValidConstraintNull(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand All @@ -114,7 +116,7 @@ public function testXMLValidConstraintNull()
$constraint->evaluate(null);
}

public function testXMLValidConstraintObject()
public function testXMLValidConstraintObject(): void
{
$this->expectException(
'PHPUnit\Framework\ExpectationFailedException'
Expand Down Expand Up @@ -146,10 +148,10 @@ private function getAssetsDir()
/**
* @param string $pattern
*/
private function expectExceptionMessageRegex($pattern)
private function expectExceptionMessageRegex($pattern): void
{
if (method_exists($this, 'expectExceptionMessageRegExp')) {
$this->expectExceptionMessageRegExp($pattern);
$this->expectExceptionMessageMatches($pattern);
} elseif (method_exists($this, 'expectExceptionMessageMatches')) {
$this->expectExceptionMessageMatches($pattern);
} elseif (method_exists($this, 'expectDeprecationMessageMatches')) {
Expand Down