← Patch adatlapja
AgentPatch
1. Inspect PHP Runtime vs.
1. Scoped
PHP- és Composer-frissítés
Valódi futtatókörnyezeti és ökoszisztéma-korlátok között frissíti a PHP-függőséget tudatos Composer-lockfile-módosítással.
composer-php-upgrades
Nézd meg, miben segítMikor hasznos?
Akkor használd, ha PHP-csomagot frissítenél az éles futtatókörnyezet kompatibilitásának megőrzésével.
Miben segít neked?
- Összeveti a valódi PHP- és bővítményverziót a Composer platformfeltételeivel.
- Feltárja a függőségi akadályt, és csak a célzott összetartozó csomagcsaládot frissíti.
- Ellenőrzi a lockfile-t, automatikus betöltést, keretrendszer-beállítást és elemzőeszközöket.
Például ezt kérheted
Tervezz Laravel-csomagfrissítést az éles PHP-verzióhoz, a platformkövetelmények figyelmen kívül hagyása nélkül. A tényleges PHP-bővítményekkel vizsgáld az új függőségeket. A blokkolóhoz add meg verziókorlátját, majd telepítés után ellenőrizd az érintett működést.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
Composer & PHP Upgrades
When to Use
Use when upgrading PHP libraries, frameworks (Laravel, Symfony, Doctrine, Filament, Livewire, Pest/PHPUnit, PHPStan/Psalm), or PHP runtime targets via composer.json and composer.lock.
Platform & Constraint Discovery
1. Inspect PHP Runtime vs. config.platform
- Check both
require.php(e.g.,"^8.2","~8.3.0") andconfig.platform.phpincomposer.json, alongsideDockerfile/docker-compose.yml/ CI matrix PHP versions and required PHP extensions (ext-intl,ext-gd,ext-redis,ext-imagick,ext-pcntl,ext-bcmath,ext-sodium). - Warning:
config.platform.phptells Composer to emulate a specific PHP version when resolvingcomposer.lockeven if the local CLI runs a newer PHP version. Always keepconfig.platformaligned with the lowest production PHP runtime, and never use--ignore-platform-reqs(--ignore-platform-req=php) to force an incompatible package intocomposer.lock.
2. Trace Dependency Blockers Before Updating
Use Composer's built-in solver diagnostics before changing constraints:
composer why <vendor/package>(depends): Shows which direct or transitive packages require the installed package.composer why-not <vendor/package> <target-version>(prohibits): Shows the exact version constraint chain (PHP version, sibling package, or rootcomposer.json) blocking the upgrade.composer outdated --direct: Lists outdated direct dependencies and indicates semver-safe vs. major updates.
Controlled Update Execution
1. Scoped composer update Commands
- Never run a bare
composer updateacross the whole project when upgrading a specific library—that recalculates and bumps every unlocked package incomposer.lock. - Always scope updates to the target package and its coupled dependents:
composer update vendor/package --with-all-dependencies(-W)- For coupled framework families (e.g.,
symfony/*,illuminate/*,spatie/*), pass all related packages together:composer update "symfony/*" --with-all-dependencies.
- Validate manifest integrity with
composer validate --strict.
2. Framework & Ecosystem Upgrade Nuances
- Laravel (
laravel/framework):- Upgrade coupled first-party packages in lockstep (
laravel/sanctum,laravel/horizon,laravel/passport,laravel/cashier,laravel/octane,laravel/pint,nunomaduro/collision,pestphp/pest/phpunit/phpunit). - Check
composer.jsonscripts (@php artisan package:discover --ansi,@php artisan vendor:publish), middleware registration (bootstrap/app.phpin Laravel 11+ vsapp/Http/Kernel.php), Eloquent cast/model signature changes, and published config files (config/*.php).
- Upgrade coupled first-party packages in lockstep (
- Symfony (
symfony/*):- Check
extra.symfony.requireincomposer.json(which restricts Symfony Flex recipes andsymfony/*component versions!). Updatingrequirewithout updatingextra.symfony.requirecauses solver failures. - Check Symfony Flex recipe diffs (
composer recipes,composer recipes:update) for updated bundle configs (config/packages/*.yaml) and DI container deprecations (bin/console debug:container --deprecations).
- Check
- Static Analysis & Tests (
phpstan/phpstan,larastan/larastan,vimeo/psalm,phpunit/phpunit,pestphp/pest):- PHPUnit major upgrades (e.g., PHPUnit 9 $\rightarrow$ 10 $\rightarrow$ 11) replace docblock annotations (
@test,@dataProvider) with PHP 8 attributes (#[Test],#[DataProvider]), tightenphpunit.xmlschemas (phpunit --migrate-configuration), and make data provider methodsstatic. - When upgrading PHPStan/Larastan, fix newly surfaced type errors in application code rather than bloating
phpstan-baseline.neon.
- PHPUnit major upgrades (e.g., PHPUnit 9 $\rightarrow$ 10 $\rightarrow$ 11) replace docblock annotations (
3. Composer Plugins, Patches & Autoloading
- Check
config.allow-pluginswhen a new plugin package is introduced. - If
cweagans/composer-patchesis used, verify whether each.patchfile still applies cleanly or was merged upstream. - Always run
composer dump-autoload --strict-psr(or--optimize) and verify zero PSR-4 autoloading warnings.
Csomagban lévő fájlok 1
SKILL.md
