Skip to content

Add .gitignore and .gitattributes for repo hygiene. Prevent agent/IDE folders#19

Merged
gustavofreze merged 2 commits intomainfrom
feature/develop
Apr 22, 2026
Merged

Add .gitignore and .gitattributes for repo hygiene. Prevent agent/IDE folders#19
gustavofreze merged 2 commits intomainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

…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.
Copilot AI review requested due to automatic review settings April 22, 2026 01:39
…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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BaseConverter and refactors Decimal/Hexadecimal/Base62 to 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 \x00 bytes (e.g. '001jlt60MnKnB9ECKRt4gl' is ASCII text, and hex2bin('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.

Comment thread tests/Base62Test.php
Comment thread README.md
Comment thread .gitattributes
Comment thread composer.json
Comment thread src/Internal/BaseConverter.php
@gustavofreze gustavofreze merged commit 03deef1 into main Apr 22, 2026
5 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch April 22, 2026 01:47
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.

2 participants