Skip to content

Remove obsolete SMW version checks#93

Merged
alistair3149 merged 1 commit into
masterfrom
remove-dead-smw-version-checks
Jun 2, 2026
Merged

Remove obsolete SMW version checks#93
alistair3149 merged 1 commit into
masterfrom
remove-dead-smw-version-checks

Conversation

@alistair3149

Copy link
Copy Markdown
Member

The extension now requires SemanticMediaWiki >= 7.0 (see extension.json), so the version_compare( SMW_VERSION, '1.6.1', '>' ) and version_compare( SMW_VERSION, '1.7.2', '>' ) guards in CompoundQueryProcessor are always true on every supported version. This removes the dead branches and keeps the code paths that always executed:

  • queryAndMergeResults() and getQueryResultFromQueryString(): unwrap the always-true addThisPrintout() / getProcessedParams() calls.
  • getResultFromQueryResult(): collapse the format lookup to $params['format']->getValue() and drop the unreachable pre-1.6.1 else branch (which called getResultFormat(), no longer present in SMW 7.0).

This is dead-code removal only — no behavior change on any supported SMW version, so there is no release-notes entry.

The !defined( 'SMW_VERSION' ) presence guard in SemanticCompoundQueries.php is intentionally left in place: it checks that Semantic MediaWiki is loaded at all, which is a different concern from the version comparisons removed here.

🤖 Generated with Claude Code

The extension requires SemanticMediaWiki >= 7.0, so the
version_compare( SMW_VERSION, '1.6.1'/'1.7.2', '>' ) guards in
CompoundQueryProcessor are always true. Drop the dead branches and keep
the code paths that always ran: unwrap the addThisPrintout() /
getProcessedParams() calls, collapse the format lookup in
getResultFromQueryResult() to $params['format']->getValue(), and remove
its unreachable pre-1.6.1 else branch.
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.08%. Comparing base (33cc6fb) to head (3703ec1).

Files with missing lines Patch % Lines
src/CompoundQueryProcessor.php 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #93      +/-   ##
============================================
+ Coverage     28.57%   30.08%   +1.51%     
+ Complexity       44       40       -4     
============================================
  Files             3        3              
  Lines           119      113       -6     
============================================
  Hits             34       34              
+ Misses           85       79       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alistair3149 alistair3149 marked this pull request as ready for review June 2, 2026 23:20
@alistair3149 alistair3149 merged commit 6932a8d into master Jun 2, 2026
7 of 11 checks passed
@alistair3149 alistair3149 deleted the remove-dead-smw-version-checks branch June 2, 2026 23:20
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.

1 participant