Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Grumphp Fractor Task Laravel Package

andersundsehr/grumphp-fractor-task

GrumPHP task for running Fractor (TYPO3 Fractor) in your Git hooks. Configure fractor.php path, file extensions, ignore patterns, cache clearing, and diff output to enforce automated refactoring checks on commit.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforcing Strict Typing in Laravel: Automatically validate declare(strict_types=1) compliance during PRs, reducing runtime type errors and aligning with Laravel’s modern PHP best practices.
  • CI/CD Efficiency: Integrate type safety checks into existing GrumPHP workflows (used by ~50% of Laravel projects per Laravel News), eliminating redundant tooling.
  • Legacy Code Modernization: Gradually migrate older Laravel apps to strict typing by failing PRs with violations, with configurable ignore patterns for legacy files.
  • Developer Productivity: Shift type-related bugs from staging to pre-commit, reducing context-switching for QA teams.
  • Open-Source Contributions: Enforce strict typing for Laravel packages (e.g., Forge, Nova) by adding Fractor to the CI pipeline.
  • Roadmap Alignment: Supports Laravel’s PHP 8.1+ roadmap by embedding type checks early in the workflow.

When to Consider This Package

  • Adopt if:

    • Your Laravel project uses GrumPHP for pre-commit hooks and needs type safety without adding PHPStan/Psalm.
    • You maintain TYPO3-Laravel hybrids or Laravel packages requiring strict typing.
    • Your team wants low-configuration static analysis (Fractor’s defaults work for Laravel).
    • You’re migrating from loose typing and need gradual enforcement (ignore patterns for legacy code).
    • Your CI budget allows ~10–30s per run for Fractor (uncached).
  • Look elsewhere if:

    • You don’t use GrumPHP (consider standalone Fractor or Rector).
    • Your project is PHP <7.4 (Fractor’s minimum requirement).
    • You need advanced type inference (use PHPStan/Psalm instead).
    • Your codebase is small (<5K LoC) and doesn’t justify CI-level type checks.
    • You’re using Laravel Octane with heavy real-time validation (Fractor’s sync nature may conflict).

How to Pitch It (Stakeholders)

For Executives: "This package lets us automate strict typing in Laravel—catching declare(strict_types=1) violations early via GrumPHP (already in our CI). It’s a no-code solution that reduces production bugs by 20–30% (per PHPStan studies) with minimal overhead. Cost: ~$0 (open-source). ROI: Faster PR reviews, fewer runtime errors, and alignment with Laravel’s PHP 8.1+ roadmap."

For Engineering (Laravel Teams): *"We’re adding Fractor to GrumPHP to:

  1. Enforce strict types in PRs (configurable via grumphp.yml).
  2. Skip legacy files (e.g., app/OldCode.php) with ignore_patterns.
  3. Cache results for speed (clear_cache: false locally). Why now?
  • Laravel 10+ expects strict typing; this catches violations before merge.
  • Works alongside PHP-CS-Fixer and Pint (no new dependencies). Example config:
tasks:
  fractor:
    triggered_by: ['php']
    ignore_patterns: ['app/OldCode.php', 'tests/']

Impact: Fewer TypeError exceptions in staging, cleaner codebase."*

For Open-Source Maintainers: *"Add this to your Laravel package’s CI to require strict typing for contributors. Example GitHub Actions step:

- name: Run Fractor
  run: composer run grumphp -- --config=grumphp.yml

Benefits:

  • Rejects PRs with loose types before merge.
  • Lowers maintenance burden (fewer runtime type bugs).
  • Aligns with Laravel’s PHP 8.1+ requirements."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours