Skip to content

Commit 1fd5f6f

Browse files
committed
rework
1 parent bf29d51 commit 1fd5f6f

5 files changed

Lines changed: 11 additions & 28 deletions

File tree

ci/qa/phpcpd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
cd $(dirname $0)/../../
4+
5+
# https://github.com/sebastianbergmann/phpcpd
6+
vendor/bin/phpcpd ./src

ci/qa/phpunit.xml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.6/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/11.5/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="../../vendor/autoload.php"
8+
cacheDirectory="../../var/qa/phpunit.cache"
89
>
910
<php>
1011
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
@@ -18,16 +19,4 @@
1819
<directory>../../src/Tests/Component</directory>
1920
</testsuite>
2021
</testsuites>
21-
<coverage processUncoveredFiles="true">
22-
<include>
23-
<directory>../../src</directory>
24-
</include>
25-
<exclude>
26-
<directory>../../src/Tests</directory>
27-
</exclude>
28-
</coverage>
29-
<listeners>
30-
<listener class="\Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
31-
<listener class="\Mockery\Adapter\Phpunit\TestListener"/>
32-
</listeners>
3322
</phpunit>

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"require-dev": {
2222
"ext-libxml": "*",
2323
"ext-zlib": "*",
24+
"irstea/phpcpd-shim": "^6.0",
2425
"malukenho/docheader": "^1.1",
2526
"mockery/mockery": "^1.5",
2627
"overtrue/phplint": "*",
@@ -43,6 +44,7 @@
4344
"@composer-validate",
4445
"@license-headers",
4546
"@phplint",
47+
"@phpcpd",
4648
"@phpcs",
4749
"@phpmd",
4850
"@test",

src/SAML2/Attribute/ConfigurableAttributeSetFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static function configureWhichAttributeSetToCreate(mixed $attributeSetCla
3131
throw InvalidArgumentException::invalidType('non-empty string', 'attributeSetClassName', $attributeSetClassName);
3232
}
3333

34-
if (!is_a($attributeSetClassName, '\Surfnet\SamlBundle\SAML2\Attribute\AttributeSetFactory', true)) {
34+
if (!is_a($attributeSetClassName, AttributeSetFactory::class, true)) {
3535
throw new InvalidArgumentException(sprintf(
3636
'Cannot use class "%s": it must implement "%s"',
3737
$attributeSetClassName,

src/Tests/Component/Metadata/XsdValidator.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222

2323
class XsdValidator
2424
{
25-
/**
26-
* Validate an XML document against an XSD schema
27-
*
28-
* @param DOMDocument $document The XML document to validate
29-
* @param string $xsdPath Path to the XSD schema file
30-
* @return array Empty array if valid, array of error messages if invalid
31-
*/
3225
public function validate(DOMDocument $document, string $xsdPath): array
3326
{
3427
if (!file_exists($xsdPath)) {
@@ -56,13 +49,6 @@ public function validate(DOMDocument $document, string $xsdPath): array
5649
return [];
5750
}
5851

59-
/**
60-
* Check if an XML document is valid against an XSD schema
61-
*
62-
* @param DOMDocument $document The XML document to validate
63-
* @param string $xsdPath Path to the XSD schema file
64-
* @return bool True if valid, false otherwise
65-
*/
6652
public function isValid(DOMDocument $document, string $xsdPath): bool
6753
{
6854
return empty($this->validate($document, $xsdPath));

0 commit comments

Comments
 (0)