yuseflockwood/phpdoc-stripper
Composer 安装命令:
composer require yuseflockwood/phpdoc-stripper
包简介
A CLI tool to remove PHPDoc comments from PHP files recursively.
README 文档
README
A simple CLI tool to recursively remove PHPDoc comments from PHP files.
👥 Installation
Global Installation (Recommended)
To install the tool globally using Composer:
composer global require yuseflockwood/phpdoc-stripper
Project-Based Installation
If you want to use it within a specific project:
composer require yuseflockwood/phpdoc-stripper --dev
🚀 Usage
Run the Tool on a Directory
To remove all PHPDoc comments in a specific directory, run:
phpdoc-stripper -d /path/to/project
If no directory is specified, it defaults to the current working directory.
Example:
phpdoc-stripper
(This will run in the directory where the command is executed.)
⚙️ How It Works
- The script recursively scans all PHP files in the given directory.
- It removes PHPDoc comments (
/** ... */) while leaving normal code and comments (//or/* ... */) intact. - Modifies files in place, so ensure you have backups before running!
📝 Example
Before running phpdoc-stripper:
<?php /** * This function adds two numbers. * * @param int $a The first number. * @param int $b The second number. * @return int The sum of both numbers. */ function add($a, $b) { return $a + $b; }
After running phpdoc-stripper:
<?php function add($a, $b) { return $a + $b; }
⚠️ Warning: Use with Caution
- This tool permanently modifies files by stripping PHPDoc comments.
- Backup your project before running, or use version control.
📝 License
This project is licensed under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-17