php-transform

Transform PHP code to adopt Space-Utils patterns and functions.

3|1|Updated Apr 18, 2021
One-click install
npx skills add https://github.com/nashgao/mqtt-client --skill php-transform
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-transform
Source: https://github.com/nashgao/mqtt-client/tree/main/.claude/skills/php-transform
Command: npx skills add https://github.com/nashgao/mqtt-client --skill php-transform

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the modernization of PHP code by transforming it to adopt Space-Utils patterns and functions, improving code quality and maintainability.

Core Features & Use Cases

  • Automated Code Transformation: Replaces legacy function calls with Space-Utils equivalents.
  • Pattern Modernization: Updates code to use modern PHP constructs and Space-Utils paradigms.
  • Type Safety Enforcement: Adds type hints and return types where appropriate.
  • Use Case: Refactor a large PHP codebase to use SpaceUtils::request()->get('param') instead of $_GET['param'] and isset().

Quick Start

Run the php-transform command on the file src/Model/User.php to apply transformations.

Frequently Asked Questions about php-transform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate PHP code refactoring to replace legacy function calls?

Automated PHP code refactoring replaces legacy function calls with Space-Utils equivalents to modernize codebases. The transformation script processes specified files or directories, updating patterns and enforcing type safety without manual intervention.

How do I modernize PHP code to use Space-Utils patterns?

Modernizing PHP code with Space-Utils patterns involves transforming function calls and updating code constructs. This process replaces outdated syntax with Space-Utils paradigms, enhancing code quality and maintainability across the target files.

Can I add type hints and return types to PHP files automatically?

Type safety improvements in PHP files can be applied automatically by adding type hints and return types where appropriate. The transformation scans specified directories and updates type declarations to align with Space-Utils patterns.

Does the PHP code transformation support post-refactoring quality validation?

Post-transformation quality assurance is supported through integration with Space-Utils validation tools. After the automated refactoring process completes, these tools verify that the updated code meets the required quality and pattern standards.

What is the best way to refactor a large PHP codebase to use Space-Utils request methods?

Refactoring a large PHP codebase to use Space-Utils request methods is best handled by running the transformation command on target files. This replaces standard superglobal accesses like $_GET with SpaceUtils::request()->get() equivalents.

Do I need any dependencies to run the PHP code transformation?

No external dependencies are required to run the PHP code transformation. The Skill operates standalone using its scripts component to process files and directories, applying Space-Utils patterns and type safety improvements directly.