Skip to content

Conversation

@tlaverdure
Copy link
Contributor

This pull request updates how the LitebasePDO class reports its client and server version attributes, ensuring they reflect the actual package version from Composer metadata. It also adds a unit test to verify this behavior.

Version reporting improvements:

  • The getAttribute method in LitebasePDO now returns the actual package version for both PDO::ATTR_CLIENT_VERSION and PDO::ATTR_SERVER_VERSION, using Composer's InstalledVersions API instead of a hardcoded '0.0.0' string. (src/LitebasePDO.php, src/LitebasePDO.phpL71-R73)
  • A new protected method getClientVersion() was added to encapsulate fetching the version from Composer. (src/LitebasePDO.php, src/LitebasePDO.phpR86-R93)
  • The Composer\InstalledVersions class is now imported to support version lookup. (src/LitebasePDO.php, src/LitebasePDO.phpR7)

Testing:

  • Added a unit test to ensure the reported client and server versions are non-empty strings and match each other, verifying the new version reporting logic. (tests/Unit/LitebasePDOTest.php, [1] [2]

@tlaverdure tlaverdure self-assigned this Nov 21, 2025
@tlaverdure tlaverdure merged commit a1843eb into main Nov 21, 2025
3 checks passed
@tlaverdure tlaverdure deleted the version-attributes branch November 21, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants