Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

php-upgradePHP upgrade 搜索

Agent Skill

php-upgrade 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

588

周安装

25

GitHub Stars

16

下载量

206
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:php-upgrade(PHP upgrade 搜索)
来源仓库:https://github.com/krzysztofsurdy/code-virtuoso
仓库路径:skills/php-upgrade
安装命令:
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill php-upgrade
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill php-upgrade

简介

php-upgrade 用于 PHP 版本升级相关的信息检索与筛选。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中查找 PHP 升级方案或相关资源时使用。
  • 通过关键词定位候选结果,结合来源仓库进一步核验具体用法。
  • 安装前需确认权限范围和维护状态,注意可能触发联网或文件操作。
  • 建议参考原始 README 了解实际功能和调用方式。

SKILL.md

PHP Version Upgrade

Upgrade one minor version at a time. Never skip versions -- each step surfaces deprecations that become errors in the next release. Every upgrade follows the same cycle: audit, automate, test, deploy.

Core Principles

PrincipleMeaning
Changelog firstBefore any upgrade, search the web for the official PHP migration guide (php.net/migration) or ask the user for the changelog -- never rely on static knowledge alone
One version at a timeUpgrade 8.1 -> 8.2 -> 8.3 -> 8.4 sequentially -- skipping versions makes it impossible to isolate breakage
Fix deprecations before upgradingDeprecations in version N become errors in version N+1 -- treat them as mandatory fixes
Automate first, manual secondRun Rector and PHPCompatibility before touching code by hand -- they catch 80%+ of required changes
Prove it with testsNever consider an upgrade complete without a passing test suite on the target version
Pin your platformSet config.platform.php in composer.json to match your lowest deployment target

Upgrade Process Overview

Phase 0: Read the Changelog

Before touching any code, obtain the actual changelog for the target PHP version:

  1. Search the web for PHP X.Y migration guide (e.g., PHP 8.4 migration guide php.net)
  2. Or ask the user to provide the changelog / release notes
  3. Read the official migration page at https://www.php.net/manual/en/migrationXY.php

This is non-negotiable. Each version has unique changes that static skill knowledge cannot fully capture.

Phase 1: Audit

Before changing any code, understand the scope of the upgrade.

  1. Run PHPCompatibility against the target version to identify incompatible code
  2. Run php-parallel-lint with the target PHP binary to catch syntax errors
  3. Run composer outdated to check if all dependencies support the target version
  4. Review the official migration guide at php.net for the target version
  5. Check PHP extensions for compatibility (ext-intl, ext-mbstring, etc.)

Phase 2: Automate

Use Rector to handle the bulk of code transformations automatically.

// rector.php
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPaths([__DIR__ . '/src', __DIR__ . '/tests'])
    ->withPhpSets(php84: true);  // adjust to target version

Always dry-run first:

vendor/bin/rector process --dry-run

Review changes, then apply:

vendor/bin/rector process

Commit Rector changes separately from manual fixes for clean git history.

Phase 3: Update Dependencies

  1. Update composer.json with the new PHP version constraint: "php": ">=8.4"
  2. Update config.platform.php to match the target version
  3. Run composer update and resolve conflicts
  4. Update PHP extensions as needed

Phase 4: Test and Deploy

  1. Run the full test suite under the new PHP version
  2. Run static analysis (PHPStan/Psalm)
  3. Deploy to staging and verify
  4. Monitor production logs for deprecation notices after deployment

See Upgrade Process Reference for detailed tool configuration, CI pipeline setup, and Docker considerations.


Tools

ToolPurposeWhen to Use
RectorAutomated AST-based code transformationFirst step after auditing -- handles most mechanical changes
PHPCompatibilityPHP_CodeSniffer ruleset for cross-version compatibilityAudit phase -- identifies all incompatible code before you start
php-parallel-lintParallel syntax checking (~20x faster than serial)Audit phase -- catches syntax errors under the new version
PHPStan/PsalmStatic analysisVerification phase -- catches type errors after transformation
symfony/phpunit-bridgeDeprecation summary in test outputOngoing -- monitors deprecation count during upgrades

Breaking Changes by Version

TransitionKey Breaking Changes
8.0 -> 8.1Fibers introduced, enums added, readonly properties, intersection types, never return type
8.1 -> 8.2Dynamic properties deprecated (use #[AllowDynamicProperties] temporarily), $GLOBALS access restrictions, readonly classes, disjunctive normal form types
8.2 -> 8.3Typed class constants, json_validate() added, #[Override] attribute, Randomizer additions, date/time exception changes
8.3 -> 8.4Implicit nullable types deprecated (function foo(string $bar = null) must become ?string $bar = null), property hooks, asymmetric visibility, new without parentheses deprecated for no-arg constructors, DOM extension namespace changes

See Version Changes Reference for complete per-version details with code examples.


Common Pitfalls

PitfallWhy It HurtsPrevention
Skipping versionsCannot isolate which changes broke whatAlways upgrade one version at a time
Ignoring deprecation warningsDeprecations become fatal errors in the next versionFix all deprecations before upgrading
Not checking dependenciesThird-party packages may not support the target versionRun composer outdated and check support before starting
Using --ignore-platform-reqsBypasses safety checks, causes runtime errorsNever use it -- fix the actual constraints instead
Not pinning config.platform.phpLocal PHP differs from production, causing install mismatchesAlways set it to match production
Large unreviewed Rector runsRector can make incorrect transformations in edge casesAlways dry-run first, review changes, run on small batches
Forgetting PHP extensionsExtensions change behavior or get deprecated between versionsAudit all required extensions before upgrading

Quick Reference: Upgrade Checklist

  • Review php.net migration guide for target version
  • Run PHPCompatibility scan against target version
  • Run php-parallel-lint with target PHP binary
  • Verify all Composer dependencies support target version
  • Configure and run Rector with target version set (dry-run first)
  • Review and commit Rector changes
  • Apply manual fixes for remaining issues
  • Update composer.json PHP constraint and config.platform.php
  • Run composer update
  • Run full test suite on target PHP version
  • Run static analysis (PHPStan/Psalm)
  • Deploy to staging and verify
  • Deploy to production and monitor logs

Reference Files

ReferenceContents
Upgrade ProcessDetailed tool configuration, CI pipeline setup, Docker strategy, and step-by-step commands
Version ChangesPer-version breaking changes, new features, and deprecations with code examples (PHP 8.0 through 8.4)

Integration with Other Skills

SituationRecommended Skill
Upgrading Symfony alongside PHPUse the symfony-upgrade skill in frameworks/symfony/
Updating Composer dependencies after PHP upgradeUse the composer-dependencies playbook skill
Modernizing PHP code patterns (DTOs, enums, strict types)Install php-modernization from dirnbauer/webconsulting-skills or netresearch/php-modernization-skill
Running static analysis after upgradeInstall knowledge-virtuoso from krzysztofsurdy/code-virtuoso for testing strategies

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.64%
按下载量换算73

Claude

30.08%
按下载量换算62

Cursor

20.7%
按下载量换算43

Gemini CLI

10.63%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills