Skip to content

fix: PHPMD does not require schema validation#70

Open
rutgerrademaker wants to merge 1 commit intomasterfrom
feature/remove-phpmd-schema-validation
Open

fix: PHPMD does not require schema validation#70
rutgerrademaker wants to merge 1 commit intomasterfrom
feature/remove-phpmd-schema-validation

Conversation

@rutgerrademaker
Copy link
Contributor

The simplest fix is to remove the schema declaration.

@rutgerrademaker rutgerrademaker force-pushed the feature/remove-phpmd-schema-validation branch from e8998e4 to aa19c0d Compare March 6, 2026 08:22
This makes github actions fail for php 8.2 and 8.3
The simplest fix seems tobe to remove the schema declaration.
@rutgerrademaker rutgerrademaker force-pushed the feature/remove-phpmd-schema-validation branch from aa19c0d to 89c803e Compare March 6, 2026 08:25
@Anve94
Copy link
Member

Anve94 commented Mar 6, 2026

Curious what other people think of this. It would make sense if we would still be able to validate our phpmd ruleset against the xsd (it's the purpose of the schema definition after all) instead of outright removing it. Maybe we can store a local copy and refer to the local copy instead? Ultimately I am not against this change but am wondering whether there may be better alternatives where we don't sacrifice the xsd validation for convenience (even if it is just one specific xml file we no longer validate against the schema, there's still a risk here)

@youwe-petervanderwal
Copy link
Contributor

Curious what other people think of this. It would make sense if we would still be able to validate our phpmd ruleset against the xsd (it's the purpose of the schema definition after all) instead of outright removing it. Maybe we can store a local copy and refer to the local copy instead? Ultimately I am not against this change but am wondering whether there may be better alternatives where we don't sacrifice the xsd validation for convenience (even if it is just one specific xml file we no longer validate against the schema, there's still a risk here)

Seems that PHPMD maintainer already 2 years ago did an update with the urls
phpmd/phpmd@b85ecc8

but that commit is never released.
Also that URL is no longer working :(

Raises the question: is PHPMD still maintained? But that's off-topic for now I guess.

What I can find is this XSD https://raw.githubusercontent.com/phpmd/phpmd/47d4d8f111a7ee2eac02bde29fb9c517bec778bb/src/site/resources/web/xml/ruleset_xml_schema_1.0.0.xsd

That's in the master branch only though, but because it has the same XSD version number I expect nothing is changed.

So using that one might be an option too. Including it in the repo and referencing via vendor/youwe/testing-suite/... might also be an option (if that works).

I can live with removing the XSD reference, but prefer to have it strict indeed (what Stefan said)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants