Weave 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

Typo3 Rector Laravel Package

ssch/typo3-rector

TYPO3 Rector applies instant upgrades and refactoring to TYPO3 website and extension code, easing migrations between releases and removing deprecations. Extending Rector, it supports PHP 5.3+ and requires PHP 7.4+. Always run on development environments under version control, never production.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • TYPO3-Specific Refactoring: The package remains highly specialized for TYPO3 migrations (v7–14). Laravel’s DI container is compatible with TYPO3’s legacy instantiation patterns (GeneralUtility::makeInstance() → constructor injection), but the package’s rules target TYPO3 APIs (t3lib_div, TYPO3_CONF_VARS, ext_emconf.php) that are irrelevant to Laravel core logic. v3.16.0 does not change this — all four changes are TYPO3-domain rules.
  • Rector’s Underlying Tech: Built on PHP-Parser (AST), the same tooling behind Laravel Shift and PHPStan. Low-level PHP syntax compatibility is unchanged and remains strong.
  • New in v3.16.0 — Attribute Direction: RenameClassTYPO3CMS_Extbase_AnnotationToAttributeRector migrates Extbase docblock annotations to PHP 8 attributes. This is the same conceptual shift Laravel/Symfony ecosystems are making (Symfony #[Autowire], #[Autoconfigure]; Laravel 11 #[AsCommand]). It strengthens the case for a custom laravel-rector set modelled on these rules, but the shipped rule itself operates on TYPO3\CMS\Extbase\Annotation and cannot be applied to Laravel classes.
  • New in v3.16.0 — Command Attribute: AddAsNonSchedulableCommandAttributeRector adds a TYPO3 console attribute. The Laravel analogue is Artisan command registration/scheduling (#[AsCommand], Schedule::command()->withoutOverlapping()), which is not covered by this package. Useful as a reference pattern, not a usable rule.
  • CodeQuality Preset Now Enabled: The structarmed ^0.17 bump enables the CodeQuality preset by default. This is the most architecturally meaningful change for a TPM: it widens rule scope beyond TYPO3 version migrations into generic code-quality refactors, increasing the chance of diffs in shared/hybrid code that are not TYPO3-related.

Integration Feasibility

  • Direct Integration: Still not feasible on a pure Laravel codebase. Running against Laravel code will:
    • Fail or no-op on unknown TYPO3 classes (TYPO3\CMS\Core\Utility\GeneralUtility).
    • Misinterpret Laravel’s container/configuration as TYPO3 globals.
    • Ignore Laravel-specific deprecations (Facade static calls, App::make()).
  • Indirect Use Cases (unchanged, slightly improved):
    • TYPO3–Laravel hybrids: scope the package to isolated TYPO3 extension directories only. The MigrateLabelReferenceToDomainSyntaxRector bugfix marginally improves reliability for teams already running this rule on TYPO3 modules.
    • Reference implementation for custom Laravel rules: the annotation→attribute rule is a good template for Laravel attribute migrations.
  • Toolchain Synergy: pair with Laravel Shift, PHPStan, and PHP-CS-Fixer. Note the new structarmed ^0.17 floor — verify it resolves against your pinned rector/rector and PHP-CS-Fixer versions before upgrading.
  • Release Cadence Signal: v3.14.1 → v3.15.1 → v3.16.0 in a short window indicates frequent minor releases. Plan for pinned versions plus a monthly review, not floating ^3.

Technical Risk

Risk Area Severity Mitigation Strategy
False Positives High Run --dry-run; exclude Laravel paths in .rector.php.
Broken Refactoring Critical Test in staging with Git; one rule per commit.
Preset Scope Creep High New: CodeQuality preset is on by default in v3.16.0 — explicitly disable or narrow it in config if you only want TYPO3 migration rules.
Dependency Conflicts Medium Isolate as a dev dependency; verify structarmed ^0.17 against pinned rector/rector.
Rule Misapplication High Disable TYPO3-specific rules outside designated paths.
Version Drift Medium New: pin an exact tag (e.g. 3.16.0) rather than ^3.16; minors ship weekly.
Performance Overhead Low Run in parallel; restrict withPaths().

Key Questions for a TPM

  1. Is there still a TYPO3 surface area? If no TYPO3 code exists in the repo, this package should be dropped from the dependency manifest — v3.16.0 adds no Laravel value.
  2. Preset policy: Do we opt out of the CodeQuality preset (v3.16.0 default) to keep diffs TYPO3-only, or accept broader refactors in the hybrid module? Who reviews those diffs?
  3. Attribute migration roadmap: The annotation→attribute rule confirms the ecosystem direction. Do we fund a small custom rule set for Laravel (Facade → DI, App::make() → app(), #[AsCommand]) borrowing this pattern?
  4. Upgrade gate: Has structarmed ^0.17 been validated against our pinned Rector version and CI PHP matrix?
  5. Alternatives: Laravel Shift (Laravel migrations), Symfony DI tooling, generic Rector sets — all still better fits for the Laravel side.
  6. CI/CD: Should this run only on TYPO3-related paths (path-filtered job) and never block Laravel PRs?

Integration Approach

Stack Fit

  • Laravel Core: No fit — unchanged by v3.16.0.
  • Laravel + TYPO3 Hybrid: TYPO3 extension modules can be refactored here; Laravel handles API/business logic. The MigrateLabelReferenceToDomainSyntaxRector fix improves confidence in the TYPO3 side.
  • Tooling Layer: keep Rector path-scoped via Composer script and .rector.php:
    {
      "scripts": {
        "typo3:rector": "vendor/bin/rector process --paths=typo3-extensions --dry-run"
      }
    }
    
    return static::configure()
        ->withPaths([__DIR__ . '/typo3-extensions'])
        ->withExcludedPaths([__DIR__ . '/app', __DIR__ . '/vendor']);
    
    New: explicitly set the rule/preset list rather than inheriting defaults, since v3.16.0 turns on CodeQuality.

Migration Path

  1. Assessment Phase: audit for TYPO3 dependencies (TYPO3\CMS\*, t3lib_*) and confirm a real TYPO3 surface area exists.
  2. Isolation: move TYPO3-specific code into a separate module; mock TYPO3 classes via Composer autoloading where needed.
  3. Upgrade to v3.16.0 (if already using the package):
    • Pin 3.16.0, run composer update --with-dependencies in a branch.
    • Diff the generated Rector config output before/after the upgrade to see what the CodeQuality preset newly enables.
    • Dry-run on the TYPO3 module and triage any non-TYPO3 diffs.
  4. Incremental Refactoring: start with low-risk rules (RemoveTypo3VersionChecksRector); add annotation→attribute migration as a discrete, reviewable changeset (high diff volume, PHP 8 requirement).
  5. Laravel-Specific Adaptations (optional): fork/custom-set removing TYPO3 rules and adding Laravel rules — the new attribute rules are a usable template.

Compatibility

Component Compatibility Notes
PHP Version High PHP 7.4–8.x; attribute rules require PHP 8.0+ target code.
Composer High Dev dependency.
Rector Core High PHP-Parser based; verify against pinned Rector version.
structarmed Medium New: requires ^0.17; check transitive resolution.
TYPO3 Classes Low Fails/no-ops if Laravel code references TYPO3\CMS\*.
Symfony DI Medium Autoconfigure/attribute rules may collide with Laravel attributes.
Laravel Facades None No rules for Cache::remember(), Auth::user(), etc.

Sequencing

  1. Pre-Refactor: Git tag; write .rector.php with excluded paths and explicit rule lists (do not rely on the new default preset).
  2. Dry Run: --dry-run on TYPO3 modules; review git diff; separate CodeQuality-driven changes from migration-driven ones.
  3. Test Suite: run Laravel tests before/after; add TYPO3-specific tests where applicable.
  4. Post-Refactor: commit per-rule; update docs for refactored APIs (annotation→attribute is a documentation-visible change).
  5. Monitoring: watch for TYPO3 feature regressions; retain Rector output logs for audit.

Operational Impact

Maintenance

  • Dev Dependency Overhead: ~50MB in vendor/ (Rector + TYPO3 rules). No change.
  • Rule Updates: TYPO3 v14+ evolution will keep breaking/adding rules. The v3.15.1 → v3.16.0 cadence (four PRs, one bugfix) implies a steady maintenance tax just to stay current.
  • Preset Ownership: someone must own the decision of which presets/rules are active — the CodeQuality default is now a config decision, not an inherited one.
  • Dependency Risk: ssch/typo3-rector now depends on structarmed ^0.17; a transitive major bump is the most likely upgrade blocker.

Support

  • Single-maintainer-dominant project (@simonschaufi authored 3 of 4 PRs) — bus factor risk. Escalation path is GitHub issues only.
  • Bugfixes like the label-reference rule arrive reactively; budget review time for each minor.

Scaling

  • Refactoring time scales with the TYPO3 module size; path scoping keeps Laravel CI unaffected.
  • As the hybrid grows, keeping TYPO3 code in a dedicated directory remains the key scaling lever — without it, rule scope and review burden grow non-linearly.
  • Attribute migrations produce large diffs; schedule them as dedicated, low-traffic changesets to avoid merge conflicts across parallel feature work.

Failure Modes

  • Silent no-op: run against Laravel code — appears "clean" while providing zero value; teams may falsely conclude code is modernized.
  • Over-broad refactor: CodeQuality preset rewriting shared code without TYPO3 relevance — highest new risk in v3.16.0.
  • Class-rename breakage: annotation→attribute changes can break runtime behavior if TYPO3 version doesn’t support attributes (target PHP/TYPO3 version must be validated).
  • Composer resolution failure: structarmed ^0.17 conflicting with pinned tooling blocks CI mid-sprint.
  • Partial application: interrupted runs leave mixed annotation/attribute code.

Ramp-up

  • Low for existing users: v3.16.0 is additive — no breaking changes to existing rule names or config surface documented.
  • Medium for new adopters: requires understanding Rector sets, presets, and TYPO3 extension layout before touching config.
  • Recommendation: treat as a maintenance-only dependency for the hybrid module, pin to 3.16.0, gate upgrades behind a dry-run review, and do not invest in it as a Laravel modernization tool.
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.
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin