PHPackages                             yuseflockwood/phpdoc-stripper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. yuseflockwood/phpdoc-stripper

ActiveLibrary[CLI &amp; Console](/categories/cli)

yuseflockwood/phpdoc-stripper
=============================

A CLI tool to remove PHPDoc comments from PHP files recursively.

05PHP

Since Feb 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/YusefLockwood/phpdoc-stripper)[ Packagist](https://packagist.org/packages/yuseflockwood/phpdoc-stripper)[ RSS](/packages/yuseflockwood-phpdoc-stripper/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHPDoc Stripper
===============

[](#phpdoc-stripper)

A simple CLI tool to recursively remove PHPDoc comments from PHP files.

👥 Installation
--------------

[](#-installation)

### **Global Installation (Recommended)**

[](#global-installation-recommended)

To install the tool globally using Composer:

```
composer global require yuseflockwood/phpdoc-stripper
```

### **Project-Based Installation**

[](#project-based-installation)

If you want to use it within a specific project:

```
composer require yuseflockwood/phpdoc-stripper --dev
```

---

🚀 Usage
-------

[](#-usage)

### **Run the Tool on a Directory**

[](#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
---------------

[](#️-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
---------

[](#-example)

Before running `phpdoc-stripper`:

```
