Skip to content

Align project with tiny-blocks conventions and promote InvalidCast.#28

Merged
gustavofreze merged 11 commits into
mainfrom
feature/develop
May 16, 2026
Merged

Align project with tiny-blocks conventions and promote InvalidCast.#28
gustavofreze merged 11 commits into
mainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 16, 2026 16:16
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 aligns the project with the codified tiny-blocks conventions and promotes InvalidCast from Internal/Exceptions/ to the public Exceptions/ namespace. It also consolidates ObjectBuilder, removes the dedicated extractConstructorParameters helper, refreshes documentation/CI/tooling files, and reorganizes tests under a Unit namespace with refined BDD annotations.

Changes:

  • Promote InvalidCast to the public TinyBlocks\Mapper\Exceptions namespace and update all references.
  • Inline and simplify ObjectBuilder::build (constructor handling, private-constructor instantiation) and drop ReflectionExtractor::extractConstructorParameters.
  • Refresh .claude/rules/*, composer.json scripts, phpunit.xml, phpstan.neon.dist, Makefile, README, and add SECURITY/issue/PR templates plus new tests for missing-key fallback and enum pass-through.

Reviewed changes

Copilot reviewed 49 out of 50 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Exceptions/InvalidCast.php New public exception with docblocks.
src/Internal/Exceptions/InvalidCast.php Old internal exception removed.
src/Internal/Builders/ObjectBuilder.php Inlined arg building and instantiation; no longer depends on ReflectionExtractor.
src/Internal/Extractors/ReflectionExtractor.php Dropped extractConstructorParameters, added named args to getProperties.
src/Internal/Mappers/Object/Casters/*.php Updated InvalidCast import and removed named args on native funcs.
src/Internal/Detectors/ValueObjectDetector.php Added named args to reflection calls.
src/Internal/Extractors/ValuePropertyExtractor.php Added named args to reflection calls.
src/Internal/Resolvers/RecursiveValueResolver.php Renamed lambda variable $item$element.
src/Internal/Resolvers/StrategyResolverContainer.php Reordered get/set methods.
src/Internal/Strategies/IterableMappingStrategy.php Renamed lambda variable $item$element.
src/Internal/Transformers/Transformer.php Expanded docblock to justify transform verb.
src/ObjectMappability.php Constructs ObjectBuilder directly via PHP 8.4 chaining.
src/ObjectMapper.php, src/IterableMapper.php, src/KeyPreservation.php Updated imports/docs.
tests/Unit/*.php Moved into Test\TinyBlocks\Mapper\Unit namespace; tests refactored with BDD annotations; new tests added.
composer.json Added keywords, restructured scripts (configure, configure-and-update, review, tests).
phpunit.xml, phpstan.neon.dist, phpcs.xml, infection.json.dist Tooling reshaped per canonical templates, reports moved to reports/.
Makefile, .gitignore, .gitattributes, .editorconfig Tooling/structure updates aligned with conventions.
README.md, SECURITY.md, .github/PULL_REQUEST_TEMPLATE.md, .github/ISSUE_TEMPLATE/*.md, .github/copilot-instructions.md Documentation refresh and new templates.
.github/workflows/*.yml Added concurrency/timeouts/PHP-version resolution; pin auto-assign to major tag.
.claude/CLAUDE.md, .claude/rules/*.md Restructured into per-topic rule files; removed obsolete github-workflows.md.
Comments suppressed due to low confidence (2)

tests/Unit/EnumMappingTest.php:109

  • The @Given block has no expression below it. Per .claude/rules/php-library-testing.md rule 3, each @Given/@And block must contain one annotation followed by one expression or assignment (the data-provider exception does not apply here). Move the inline iterable into a $data (or similar) assignment under the @Given, then pass it to Amount::fromIterable in the @When step. The previous version of this test followed that shape.
    tests/Unit/ObjectMappingTest.php:353
  • The @Given annotation has no expression below it; the @When block is immediately concatenated. Per .claude/rules/php-library-testing.md rule 3, each @Given/@And block must contain one expression or assignment (data-provider exception does not apply). Consider declaring the iterable under the @Given and the hydration call under the @When.

Comment thread composer.json
@gustavofreze gustavofreze merged commit ab84c08 into main May 16, 2026
6 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch May 16, 2026 16:22
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