Add .gitignore and .gitattributes for repo hygiene. Prevent agent/IDE folders#19
Merged
gustavofreze merged 2 commits intomainfrom Apr 22, 2026
Merged
Add .gitignore and .gitattributes for repo hygiene. Prevent agent/IDE folders#19gustavofreze merged 2 commits intomainfrom
gustavofreze merged 2 commits intomainfrom
Conversation
…ent/IDE folders (.claude, .idea, .vscode) from being versioned and exclude dev-only files (tests, phpstan, phpcs, phpunit configs) from the Packagist tarball via export-ignore.
…ent/IDE folders (.claude, .idea, .vscode) from being versioned and exclude dev-only files (tests, phpstan, phpcs, phpunit configs) from the Packagist tarball via export-ignore.
There was a problem hiding this comment.
Pull request overview
This PR broadens repo hygiene/configuration while also refactoring the Base62 conversion internals and updating development tooling/docs for the PHP encoder library.
Changes:
- Introduces a shared internal
BaseConverterand refactorsDecimal/Hexadecimal/Base62to use it. - Renames/restructures PHPUnit tests and data providers for Base62 behaviors.
- Adds/updates repo hygiene and contributor/agent guidance files (
.gitattributes,.editorconfig,.claude/*, Copilot instructions) and refreshes tooling configuration (composer.json, Makefile, phpstan).
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Base62Test.php | Renames tests/providers and adjusts Base62 test scenarios/fixtures. |
| src/Internal/Hexadecimal.php | Refactors base conversion logic and adds small API tweaks (bytes() accessor). |
| src/Internal/Decimal.php | Delegates conversion logic to shared converter. |
| src/Internal/BaseConverter.php | Adds a shared internal base conversion helper. |
| src/Base62.php | Renames internal payload variable and adapts to Hexadecimal::bytes() + formatting tweaks. |
| phpstan.neon.dist | Adjusts PHPStan config (removes ignoreErrors section). |
| composer.json | Reorders/updates metadata, tooling deps, and scripts/plugins configuration. |
| README.md | Makes code examples self-contained by adding <?php, strict_types, and use statements. |
| Makefile | Adds composer normalize/outdated targets and tweaks help text. |
| .gitignore | Small ordering tweak. |
| .github/copilot-instructions.md | Adds agent guidance pointing at .claude/* rules. |
| .gitattributes | Adds line ending normalization, diff drivers, and export-ignore rules. |
| .editorconfig | Adds formatting defaults (LF, whitespace trimming, Makefile tabs). |
| .claude/rules/php-library-testing.md | Adds explicit PHPUnit/BDD and testing conventions. |
| .claude/rules/php-library-modeling.md | Adds architecture and public API boundary rules. |
| .claude/rules/php-library-documentation.md | Adds documentation/README conventions. |
| .claude/rules/php-library-code-style.md | Adds PHP code style and semantic rules. |
| .claude/rules/github-workflows.md | Adds workflow conventions for GitHub Actions. |
| .claude/CLAUDE.md | Adds overarching project guidance and validation commands. |
Comments suppressed due to low confidence (1)
tests/Base62Test.php:131
providerForRoundTripWithLeadingZeroBytes()includes values that are not binary payloads with leading\x00bytes (e.g.'001jlt60MnKnB9ECKRt4gl'is ASCII text, andhex2bin('07d8...')does not start with a zero byte). This means the test name/data provider are not actually exercising the intended “leading zero bytes” behavior. Update these fixtures so every provided payload truly begins with one or more zero bytes.
public static function providerForRoundTripWithLeadingZeroBytes(): array
{
return [
'Leading zero bytes 01' => ['value' => '001jlt60MnKnB9ECKRt4gl'],
'Leading zero bytes 02' => ['value' => hex2bin('07d8e31da269bf28')],
'Leading zero bytes 03' => ['value' => hex2bin('0000010203040506')]
];
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.