yuseflockwood / phpdoc-stripper
A CLI tool to remove PHPDoc comments from PHP files recursively.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yuseflockwood/phpdoc-stripper
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-12-17 20:56:58 UTC
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.