Skip to content

feat: add domain exception classes and wire into throw sites#75

Merged
ksandell merged 10 commits intodevelopfrom
docs/helper-classes
Mar 30, 2026
Merged

feat: add domain exception classes and wire into throw sites#75
ksandell merged 10 commits intodevelopfrom
docs/helper-classes

Conversation

@ksandell
Copy link
Copy Markdown
Contributor

@ksandell ksandell commented Mar 30, 2026

Summary

  • Add 4 missing exception classes documented in the API Reference: CacheException, ConfigException, DatabaseException, MiddlewareException — all extending SpinException
  • Wire CacheException into src/Cache/Adapters/Apcu.php and Redis.php (replaces \RuntimeException)
  • Wire ConfigException into src/Core/Config.php (replaces SpinException, adds $previous chaining on JSON parse errors)
  • Wire DatabaseException into src/Database/PdoConnection.php (rawQuery/rawExec) and src/Core/ConnectionManager.php (password-sanitization logic preserved — no $previous on sanitized path)
  • Add 28 new PHPUnit tests (tests/Exceptions/) — 7 per exception class
  • Update PdoConnectionInterface @throws docblocks
  • Update changelog.md, composer.json, package.json, VERSION to 0.0.40

Exception hierarchy

\Exception
  └── Spin\Exceptions\SpinException  (existing)
        ├── Spin\Exceptions\CacheException
        ├── Spin\Exceptions\ConfigException
        ├── Spin\Exceptions\DatabaseException
        └── Spin\Exceptions\MiddlewareException

Test plan

  • ./vendor/bin/phpunit tests/Exceptions/ — 28 tests, all PASS
  • ./vendor/bin/phpunit tests/Cache/ — no regressions (APCu/Redis skipped if unavailable)
  • ./vendor/bin/phpunit tests/Database/ — 2 new exception-type tests PASS with live MySQL, SKIP without
  • Full suite: ./vendor/bin/phpunit — no new failures

Expand User-Guide/Helpers.md section 2 with full API documentation
for all six helper classes: ArrayToXml, Cipher, Hash, UUID, JWT, EWT.

JWT and EWT were previously undocumented. Existing stubs for
ArrayToXml, Cipher, Hash, and UUID are replaced with complete method
signatures, parameter descriptions, usage examples, and guidance on
when to use each class (e.g. JWT vs EWT, UUID v4 vs v7).
@ksandell ksandell changed the title docs: add complete reference for all Spin\Helpers classes feat: add domain exception classes and wire into throw sites Mar 30, 2026
@ksandell ksandell merged commit 4a32885 into develop Mar 30, 2026
4 checks passed
@ksandell ksandell deleted the docs/helper-classes branch March 30, 2026 06:42
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