Skip to content

Allow reflection-docblock v6 & fix mixin generation in Windows#80

Merged
martinsoenen merged 10 commits into
xefi:mainfrom
ayrtonandino:update-phpdocumentor
May 10, 2026
Merged

Allow reflection-docblock v6 & fix mixin generation in Windows#80
martinsoenen merged 10 commits into
xefi:mainfrom
ayrtonandino:update-phpdocumentor

Conversation

@ayrtonandino
Copy link
Copy Markdown
Contributor

@ayrtonandino ayrtonandino commented Apr 30, 2026

This PR updates composer.json to allow reflection-docblock v6, with range "phpdocumentor/reflection-docblock": "^5.6|^6.0", no breaking changes.

Also does some cleaning:

  • Update workflow actions to latest (fixes warning Node.js 20 actions are deprecated)
  • Exclude autogenerated (and uncommitted) files in .gitignore, faker_mixin.php and packages.php
  • Upgrade phpunit to v12, which requires php >= 8.3, same as current supported php version, and receives bugfixes until February 5, 2027

Summary by CodeRabbit

  • Chores

    • Updated CI actions for improved stability.
    • Adjusted project ignores and build optimization.
  • Tests

    • Upgraded testing framework and added a simplified test script.
    • Reorganized test namespaces for clearer structure.
  • Documentation

    • Clarified README example to use fully-qualified class instantiation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

Workflows updated to newer action versions; Composer settings, dependency constraints, and scripts adjusted; README example namespace fixed; .gitignore expanded; multiple unit tests were namespaced or updated to use fully-qualified Faker instantiation.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
/.github/workflows/packagist-deploy.yml, /.github/workflows/tests.yml
Bumped actions/checkout v4→v6; bumped actions/cache v4→v5 in tests workflow; step logic and inputs unchanged.
Composer & Scripts
composer.json
Expanded phpdocumentor/reflection-docblock constraint to allow ^6.0, upgraded phpunit/phpunit to ^12.5.23, enabled config.optimize-autoloader, adjusted generate-mixin script to use @php, and added a colored test script.
Repository Metadata
/.gitignore
Added faker_mixin.php and packages.php entries; re-added/adjusted .idea line ending.
Documentation
README.md
Updated example to reference \Xefi\Faker\Faker with a leading root namespace in the code snippet.
Unit Tests — Namespace/Instantiation fixes
tests/Unit/...
tests/Unit/PackageManifestTest.php, tests/Unit/ProviderRepositoryTest.php, tests/Unit/LocaleTest.php, tests/Unit/Extensions/GeographicalExtensionTest.php, tests/Unit/Strategies/ValidStrategyTest.php
Added or corrected PHP namespaces to Xefi\Faker\Tests\Unit (and sub-namespaces) and updated new instantiations to use fully-qualified \Xefi\Faker\Faker where applicable; no test logic changed.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through code and stitched the seams,
New actions gleam and composer dreams.
Tests found their homes with namespaces true,
README updated — a clearer view.
Packages pranced; the repo says woohoo! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main changes: allowing reflection-docblock v6 in composer.json and fixing mixin generation for Windows compatibility.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@martinsoenen martinsoenen left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR !

A lot of interesting adjustments. We just need to ensure maximum packages compatibility :)

Comment thread composer.json
Comment thread composer.json Outdated
@ayrtonandino
Copy link
Copy Markdown
Contributor Author

Added a new scripts/generate-mixin.php and replace the old complicated command @php -r \"require 'vendor/autoload.php'; (new Xefi\\Faker\\Container\\Container());\" with @php scripts/generate-mixin.php

But in my testing, this only works when installing for development, in production this command should not be placed in post-install-cmd / post-update-cmd but rather in post-package-install / post-package-update.

Besides that, the mixing is not working, as is not referenced anywhere in the package so you don't get autocompletion, and still get a lot of phpstan errors.

For now i think this is ok, as this pr is intended to fix psr-4 issues, autoloading and allow reflection-docblock v6

@ayrtonandino ayrtonandino requested a review from martinsoenen May 5, 2026 12:57
@martinsoenen
Copy link
Copy Markdown
Contributor

martinsoenen commented May 7, 2026

Thanks for the replies,

This is really strange because on my side it works in multiple different environments. I need to try more. Can you please create issues with reproductible problems for the mixin things ?

I will take a look at this PR today or tomorrow to ensure your changes are OK for me. It seems good and interesting :)

Comment thread .github/workflows/tests.yml
Comment thread .github/workflows/tests.yml
@ayrtonandino
Copy link
Copy Markdown
Contributor Author

This is really strange because on my side it works in multiple different environments. I need to try more. Can you please create issues with reproductible problems for the mixin things ?

I tested it on a laravel proyect, with the laravel integration and faker() helper, using vscode, intelephense and Laravel VS Code extensions.

I got the faker_mixin.php file in my root but no autocompletion.

but maybe is my setup, need to test more.

Copy link
Copy Markdown
Contributor

@martinsoenen martinsoenen left a comment

Choose a reason for hiding this comment

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

Ok thanks ! Let's go !

@martinsoenen martinsoenen changed the title Allow reflection-docblock v6 in composer.json Allow reflection-docblock v6 & fix mixin generation in Windows May 10, 2026
@martinsoenen martinsoenen merged commit 772724b into xefi:main May 10, 2026
5 checks passed
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