Skip to content

Report 4.2.0 from QueryPath::VERSION and deprecate the version constants - #111

Merged
jakejackson1 merged 1 commit into
mainfrom
fix/issue-83
Oct 26, 2026
Merged

jakejackson1 merged 1 commit into
mainfrom
fix/issue-83

Conversation

@gravitypdf-bot

Copy link
Copy Markdown
Contributor

QueryPath::VERSION and VERSION_MAJOR were never bumped after 3.2.2, so a VERSION_MAJOR >= 4 check fails on every 4.x install.

// before (4.2.0 installed)
QueryPath::VERSION;        // '3.2.2'
QueryPath::VERSION_MAJOR;  // 3

// after
QueryPath::VERSION;        // '4.2.0'
QueryPath::VERSION_MAJOR;  // 4

Changes

  • Set the constants to the latest release, 4.2.0 / 4.
  • Mark both @deprecated in favour of \Composer\InstalledVersions::getPrettyVersion('gravitypdf/querypath') (Composer 2). They are kept, so nothing breaks, and removal can wait for 5.0.
  • Add the missing # 4.2.0 section to CHANGELOG.md (PHP 8.5 support, PHP 8.5 support #64). The 4.2.0 release had no changelog heading.

Tests

Two new tests in tests/QueryPath/QueryPathTest.php:

  • testVersionMajorMatchesVersion: VERSION_MAJOR equals the major part of VERSION.
  • testVersionMatchesLatestChangelogRelease: VERSION equals the newest # X.Y.Z heading in CHANGELOG.md. It fails on main ('3.2.2' vs '4.2.0').

Full suite, lint and lint:min-php pass.

For the maintainer

  • VERSION still has to be bumped by hand on each release. There's no release checklist or release workflow in the repo to record this in. The changelog test does enforce it: once # Unreleased changes is renamed to the new version, CI fails until VERSION matches. It can't catch a tag pushed without that changelog rename.
  • Deprecating the constants while also testing them can look contradictory. The deprecation steers people to an API that reads the installed version and can't drift. The test keeps the constants correct until they are removed.
  • Code that branched on the old wrong value (VERSION_MAJOR === 3) will now take the other branch.

Fixes #83.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.87%. Comparing base (6ae6acf) to head (d3988e9).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #111      +/-   ##
============================================
+ Coverage     90.69%   90.87%   +0.18%     
- Complexity     1424     1425       +1     
============================================
  Files            25       25              
  Lines          3170     3167       -3     
============================================
+ Hits           2875     2878       +3     
+ Misses          295      289       -6     

☔ View full report in Codecov by Harness.
📢 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.

@jakejackson1 jakejackson1 added the bug Something isn't working label Oct 26, 2026
VERSION and VERSION_MAJOR were left at 3.2.2 and 3 through the whole
4.x line. Set them to the latest release, deprecate them in favour of
Composer's InstalledVersions API, and add tests that tie VERSION to the
newest release heading in CHANGELOG.md so they cannot drift again.

Add the missing 4.2.0 changelog section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakejackson1
jakejackson1 merged commit 486cc41 into main Oct 26, 2026
14 checks passed
@jakejackson1
jakejackson1 deleted the fix/issue-83 branch October 26, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QueryPath::VERSION still reports 3.2.2 on a 4.x install

2 participants