Skip to content

docs: add PHPDoc blocks to all constant declarations (closes #63)#164

Merged
s2x merged 2 commits into
mainfrom
docs/issue-63-constants-phpdoc
Jul 8, 2026
Merged

docs: add PHPDoc blocks to all constant declarations (closes #63)#164
s2x merged 2 commits into
mainfrom
docs/issue-63-constants-phpdoc

Conversation

@s2x

@s2x s2x commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #63

Changes

  • Added descriptive PHPDoc blocks before all 65 constant declarations across 3 source files:
    • src/ZVec.php — 57 constants (index types, query params, log types/levels, buffer sizes, HNSW defaults, scalar/vector/array data types, quantize types)
    • src/ZVecSchema.php — 4 constants (METRIC_L2, METRIC_IP, METRIC_COSINE, METRIC_MIPSL2)
    • src/ZVecDoc.php — 4 constants (OP_INSERT, OP_UPDATE, OP_UPSERT, OP_DELETE)
  • Each PHPDoc includes: purpose description, numeric value, C++ enum cross-reference, and @see links to consumer methods
  • Updated CHANGELOG.md with entry under [Unreleased] - Added

Testing

  • PHP syntax: php -l passes on all 3 modified files
  • All .phpt tests pass (same results as main: 97 pass, 47 pre-existing failures)
  • No test database leftovers

Code Review

  • Passed subagent code review
  • Fixed all review comments (@see references corrected)

Added detailed PHPDoc blocks before all constant declarations across:
- src/ZVec.php (57 constants)
- src/ZVecSchema.php (4 constants)
- src/ZVecDoc.php (4 constants)

Each block documents the constant's purpose, numeric value, cross-reference
to the zvec C++ enum, and @see links to consumer methods.
@s2x s2x self-assigned this Jul 8, 2026
The DOC-004 changes added numeric values in PHPDoc blocks (e.g.
'Value: 67108864 (64 MB)'). The magic number test now filters out
PHPDoc comment lines when checking for hardcoded values.
@s2x
s2x merged commit 179eac1 into main Jul 8, 2026
3 checks passed
@s2x
s2x deleted the docs/issue-63-constants-phpdoc branch July 8, 2026 09:21
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.

DOC-004: Missing Constants Reference

1 participant