Make InvalidDecoding public and conform the library to conventions.#21
Merged
Conversation
Introduce the .claude conventions framework with path-scoped rules, the create, consume, and commit-message skills, and PostToolUse hooks for member ordering and prose punctuation. Replace the previous single CLAUDE.md with a short project index.
…entions. InvalidDecoding moves from the Internal namespace to the public Exceptions namespace so consumers can catch it without depending on internals. This is a breaking change and requires a major release. Redundant decode and encode steps and the unused Hexadecimal byte state are removed so the default Infection profile reaches MSI 100 without suppression. Members are reordered, identifiers renamed, and the toolchain and dotfiles restored to the canonical tiny-blocks shape.
Rebuild ci.yml around the resolve-php-version job with concurrency groups and per-job timeouts, and bring the security and auto-assign workflows in line with the same rules. Keep the bcmath extension and the existing action version pins.
Align the README table of contents, badge, and exception example with the documentation rules, and add the SECURITY policy, issue templates, and pull request template required by the ecosystem.
There was a problem hiding this comment.
Pull request overview
This pull request updates the library to better match tiny-blocks ecosystem conventions by promoting InvalidDecoding to the public API, refactoring the Base62 implementation and its internal helpers, and adding standardized repository tooling (CI, static analysis, mutation testing, templates, and agent rules).
Changes:
- Promote
InvalidDecodingfromsrc/Internal/Exceptions/tosrc/Exceptions/and update call sites, docs, and tests accordingly. - Refactor Base62 encoding/decoding by simplifying leading-zero handling and adjusting
Hexadecimal/BaseConverterinternals. - Add canonical tiny-blocks repository scaffolding and tooling (workflows, Makefile, QA configs,
.clauderules/skills, templates, and security policy).
Reviewed changes
Copilot reviewed 56 out of 57 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/BaseConverterTest.php | Adds a white-box test intended to cover the private constructor of the static-only BaseConverter. |
| tests/Base62Test.php | Updates test namespace/autoloading and aligns tests with the public InvalidDecoding. |
| src/Internal/Hexadecimal.php | Refactors hex handling to support leadingZeroBytes() and simplified base conversion. |
| src/Internal/Exceptions/InvalidDecoding.php | Removes the internal exception now exposed publicly. |
| src/Internal/BaseConverter.php | Converts BaseConverter into a static-only utility with a private constructor. |
| src/Exceptions/InvalidDecoding.php | Introduces public InvalidDecoding exception for consumers. |
| src/Encoder.php | Updates interface docs and imports to reference the new public exception namespace. |
| src/Base62.php | Updates Base62 to throw the public exception and refactors encode/decode internals. |
| SECURITY.md | Adds a security policy file consistent with GitHub Security Advisories reporting. |
| README.md | Updates documentation references and exception import path in examples. |
| phpunit.xml | Tightens PHPUnit configuration and moves report output paths to reports/. |
| phpstan.neon.dist | Raises PHPStan configuration to level: max, expands paths, and scopes ignores. |
| phpcs.xml | Adds PHPCS ruleset configuration (PSR-12). |
| Makefile | Updates targets to canonical tiny-blocks flow (configure, tests, review) and uses reports/. |
| infection.json.dist | Updates Infection paths and simplifies mutator configuration to defaults only. |
| composer.json | Adds keywords, updates tooling versions, aligns scripts with Makefile conventions, and updates test namespace autoloading. |
| CLAUDE.md | Adds contributor-facing conventions and validation commands for the repo. |
| .gitignore | Expands ignores to canonical tiny-blocks set (vendor, reports, caches, local overrides). |
| .github/workflows/codeql.yml | Adds concurrency and timeout to CodeQL workflow. |
| .github/workflows/ci.yml | Reworks CI to resolve PHP version dynamically and adds concurrency/timeouts. |
| .github/workflows/auto-assign.yml | Adds concurrency, permissions, timeout, and renames the job for clarity. |
| .github/PULL_REQUEST_TEMPLATE.md | Adds standard PR template. |
| .github/ISSUE_TEMPLATE/feature_request.md | Adds standard feature request template. |
| .github/ISSUE_TEMPLATE/bug_report.md | Adds standard bug report template. |
| .gitattributes | Updates export-ignore rules to ensure Packagist tarball contains only intended files. |
| .editorconfig | Adds max_line_length = 120 to match ecosystem conventions. |
| .claude/skills/tiny-blocks-create/SKILL.md | Adds scaffolding skill documentation and asset mapping for canonical repo files. |
| .claude/skills/tiny-blocks-create/assets/github/workflows/ci.yml | Adds canonical CI workflow asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/github/PULL_REQUEST_TEMPLATE.md | Adds canonical PR template asset for scaffolding. |
| .claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/feature_request.md | Adds canonical feature request template asset. |
| .claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/bug_report.md | Adds canonical bug report template asset. |
| .claude/skills/tiny-blocks-create/assets/docs/SECURITY.md | Adds canonical security policy asset. |
| .claude/skills/tiny-blocks-create/assets/config/phpunit.xml | Adds canonical PHPUnit config asset. |
| .claude/skills/tiny-blocks-create/assets/config/phpstan.neon.dist | Adds canonical PHPStan config asset. |
| .claude/skills/tiny-blocks-create/assets/config/phpcs.xml | Adds canonical PHPCS config asset. |
| .claude/skills/tiny-blocks-create/assets/config/Makefile | Adds canonical Makefile asset. |
| .claude/skills/tiny-blocks-create/assets/config/infection.json.dist | Adds canonical Infection config asset. |
| .claude/skills/tiny-blocks-create/assets/config/composer.json | Adds canonical Composer config asset. |
| .claude/skills/tiny-blocks-create/assets/config/.gitignore | Adds canonical gitignore asset. |
| .claude/skills/tiny-blocks-create/assets/config/.gitattributes | Adds canonical gitattributes asset. |
| .claude/skills/tiny-blocks-create/assets/config/.editorconfig | Adds canonical editorconfig asset. |
| .claude/skills/tiny-blocks-consume/SKILL.md | Adds dependency reuse/discovery skill for tiny-blocks ecosystem packages. |
| .claude/skills/tiny-blocks-consume/scripts/refresh-catalog.py | Adds script to refresh tiny-blocks catalog from Packagist. |
| .claude/skills/tiny-blocks-consume/references/catalog.md | Adds generated catalog of tiny-blocks packages. |
| .claude/skills/commit-message/SKILL.md | Adds Conventional Commits formatting skill documentation. |
| .claude/settings.json | Adds Claude Code settings, permissions, and PostToolUse hooks configuration. |
| .claude/rules/php-library-tooling.md | Adds canonical tooling invariants for config files. |
| .claude/rules/php-library-testing.md | Adds PHPUnit/BDD and coverage discipline rules for tests. |
| .claude/rules/php-library-modeling.md | Adds modeling rules for value objects, exceptions, enums, and complexity. |
| .claude/rules/php-library-github-workflows.md | Adds workflow conventions and canonical CI expectations. |
| .claude/rules/php-library-documentation.md | Adds README/docs conventions for the ecosystem. |
| .claude/rules/php-library-code-style.md | Adds code style rules, ordering rules, and format-string conventions. |
| .claude/rules/php-library-architecture.md | Adds public API boundary and folder layout rules. |
| .claude/rules/github-workflows.md | Removes superseded workflow rule file. |
| .claude/hooks/php-prose-punctuation-conformance.py | Adds hook enforcing punctuation rules in Markdown and PHP comments. |
| .claude/hooks/php-ordering-conformance.py | Adds hook enforcing deterministic ordering for PHP members/parameters. |
| .claude/CLAUDE.md | Removes old, less detailed Claude instructions file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.