Skip to content

Commit a082112

Browse files
authored
chore: bump dev tools and re-apply CS (#34)
1 parent 6bb329a commit a082112

File tree

5 files changed

+31
-24
lines changed

5 files changed

+31
-24
lines changed

.php-cs-fixer.dist.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
46
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
57
*
@@ -14,14 +16,14 @@
1416
use PhpCsFixer\Finder;
1517

1618
$header = <<<'EOF'
17-
This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
19+
This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
1820
19-
(c) SpacePossum
20-
Dariusz Rumiński <dariusz.ruminski@gmail.com>
21+
(c) SpacePossum
22+
Dariusz Rumiński <dariusz.ruminski@gmail.com>
2123
22-
This source file is subject to the MIT license that is bundled
23-
with this source code in the file LICENSE.
24-
EOF;
24+
This source file is subject to the MIT license that is bundled
25+
with this source code in the file LICENSE.
26+
EOF;
2527

2628
$finder = Finder::create()
2729
->exclude('tests/Fixtures')
@@ -32,9 +34,10 @@
3234
return (new Config())
3335
->setRiskyAllowed(true)
3436
->setRules([
37+
'@auto' => true,
38+
'@auto:risky' => true,
3539
'@PhpCsFixer' => true,
3640
'@PhpCsFixer:risky' => true,
37-
'@PHPUnit60Migration:risky' => true,
3841
'header_comment' => ['header' => $header],
3942
])
4043
->setFinder($finder)

dev-tools/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"require": {
3-
"php": "^8.1"
3+
"php": "^8.5"
44
},
55
"require-dev": {
6-
"ergebnis/composer-normalize": "*",
7-
"maglnet/composer-require-checker": "^3.8",
6+
"ergebnis/composer-normalize": "^2.50",
7+
"maglnet/composer-require-checker": "^4.21",
88
"mi-schi/phpmd-extension": "^4.3",
9-
"php-cs-fixer/shim": "^3.68.5",
9+
"php-cs-fixer/shim": "^3.94.2",
1010
"phpmd/phpmd": "^2.15"
1111
},
1212
"config": {

src/Constraint/XmlMatchesXsd.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
46
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
57
*
@@ -12,6 +14,4 @@
1214

1315
namespace PhpCsFixer\PhpunitConstraintXmlMatchesXsd\Constraint;
1416

15-
use PHPUnit\Runner\Version;
16-
1717
class_alias(XmlMatchesXsdForV9::class, XmlMatchesXsd::class);

src/Constraint/XmlMatchesXsdForV9.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
46
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
57
*
@@ -110,7 +112,7 @@ private function stringMatches($other)
110112
return $result;
111113
}
112114

113-
private function setXMLConstraintErrors()
115+
private function setXMLConstraintErrors(): void
114116
{
115117
foreach (libxml_get_errors() as $error) {
116118
if (LIBXML_ERR_WARNING === $error->level) {

tests/Constraint/XmlMatchesXsdTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/*
46
* This file is part of PHP CS Fixer / PHPUnit Constraint XmlMatchesXsd.
57
*
@@ -22,7 +24,7 @@
2224
*/
2325
final class XmlMatchesXsdTest extends TestCase
2426
{
25-
public function testAssertXMLMatchesXSD()
27+
public function testAssertXMLMatchesXSD(): void
2628
{
2729
$constraint = new XmlMatchesXsd($this->getXSD());
2830
$sampleFile = $this->getAssetsDir().'xliff_sample.xml';
@@ -42,14 +44,14 @@ public function testAssertXMLMatchesXSD()
4244
self::assertTrue($constraint->evaluate($content, '', true));
4345
}
4446

45-
public function testXMLValidConstraintBasics()
47+
public function testXMLValidConstraintBasics(): void
4648
{
4749
$constraint = new XmlMatchesXsd('');
4850
self::assertSame(1, $constraint->count());
4951
self::assertSame('matches XSD', $constraint->toString());
5052
}
5153

52-
public function testXMLValidConstraintFalse()
54+
public function testXMLValidConstraintFalse(): void
5355
{
5456
$this->expectException(
5557
'PHPUnit\Framework\ExpectationFailedException'
@@ -62,7 +64,7 @@ public function testXMLValidConstraintFalse()
6264
$constraint->evaluate(false);
6365
}
6466

65-
public function testXMLValidConstraintInt()
67+
public function testXMLValidConstraintInt(): void
6668
{
6769
$this->expectException(
6870
'PHPUnit\Framework\ExpectationFailedException'
@@ -75,7 +77,7 @@ public function testXMLValidConstraintInt()
7577
$constraint->evaluate(1);
7678
}
7779

78-
public function testXMLValidConstraintInvalidXML()
80+
public function testXMLValidConstraintInvalidXML(): void
7981
{
8082
$this->expectException(
8183
'PHPUnit\Framework\ExpectationFailedException'
@@ -88,7 +90,7 @@ public function testXMLValidConstraintInvalidXML()
8890
$constraint->evaluate('<a></b>');
8991
}
9092

91-
public function testXMLValidConstraintNotMatchingXML()
93+
public function testXMLValidConstraintNotMatchingXML(): void
9294
{
9395
$this->expectException(
9496
'PHPUnit\Framework\ExpectationFailedException'
@@ -101,7 +103,7 @@ public function testXMLValidConstraintNotMatchingXML()
101103
$constraint->evaluate('<a></a>');
102104
}
103105

104-
public function testXMLValidConstraintNull()
106+
public function testXMLValidConstraintNull(): void
105107
{
106108
$this->expectException(
107109
'PHPUnit\Framework\ExpectationFailedException'
@@ -114,7 +116,7 @@ public function testXMLValidConstraintNull()
114116
$constraint->evaluate(null);
115117
}
116118

117-
public function testXMLValidConstraintObject()
119+
public function testXMLValidConstraintObject(): void
118120
{
119121
$this->expectException(
120122
'PHPUnit\Framework\ExpectationFailedException'
@@ -146,10 +148,10 @@ private function getAssetsDir()
146148
/**
147149
* @param string $pattern
148150
*/
149-
private function expectExceptionMessageRegex($pattern)
151+
private function expectExceptionMessageRegex($pattern): void
150152
{
151153
if (method_exists($this, 'expectExceptionMessageRegExp')) {
152-
$this->expectExceptionMessageRegExp($pattern);
154+
$this->expectExceptionMessageMatches($pattern);
153155
} elseif (method_exists($this, 'expectExceptionMessageMatches')) {
154156
$this->expectExceptionMessageMatches($pattern);
155157
} elseif (method_exists($this, 'expectDeprecationMessageMatches')) {

0 commit comments

Comments
 (0)