- Create a new IntelliJ Platform Plugin Template project.
- Get familiar with the template documentation.
- Adjust the pluginGroup and pluginName, as well as the id and sources package.
- Adjust the plugin description in
README
(see Tips) - Review the Legal Agreements.
- Publish a plugin manually for the first time.
- Set the
MARKETPLACE_ID
in the above README badges. You can obtain it once the plugin is published to the marketplace. - Set the Plugin Signing related secrets.
- Set the Deployment Token.
- Click the Watch button on the top of the IntelliJ Platform Plugin Template to be notified about releases containing new features and fixes.
Php Constant Manager - Replace Magic Variables with Constants Effortlessly The Php Constant Manager plugin automates the process of identifying and refactoring "magic variables" (hard-coded string and integer literals) within PHP classes. It traverses your code, extracts these literals, and generates appropriate constants, enhancing code maintainability and reducing potential errors.
Key Features:
Automated Refactoring: Automatically detect and replace hard-coded string and integer literals in your PHP classes with well-named constants. Intelligent Naming: Generates meaningful constant names based on the literal's context, ensuring that your code remains clean and understandable. Selective Processing: Skips test classes and already defined constants, focusing only on parts of your code that need refactoring. Easy Integration: Integrates seamlessly into PhpStorm's workflow, triggered through a simple action within the IDE. Usage Instructions:
Install the Php Constant Manager plugin through the JetBrains Plugin Marketplace. Open any PHP file within PhpStorm and navigate to a class with hard-coded literals. Trigger the action by right-clicking within the editor or through the "Replace Magic Variables" -> "automatic" action in the command palette. The plugin will analyze the file, generate constants, and replace the literals, providing log information about the changes made. This plugin is ideal for developers looking to enhance code quality by reducing the reliance on hard-coded values and ensuring that constants are used consistently throughout the codebase.
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "php-constant-manager" > Install
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.