PHPackages                             pxlrbt/php-scoper-prefix-remover - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pxlrbt/php-scoper-prefix-remover

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pxlrbt/php-scoper-prefix-remover
================================

0.2.0(4y ago)101.6k4[1 PRs](https://github.com/pxlrbt/php-scoper-prefix-remover/pulls)PHP

Since Oct 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pxlrbt/php-scoper-prefix-remover)[ Packagist](https://packagist.org/packages/pxlrbt/php-scoper-prefix-remover)[ RSS](/packages/pxlrbt-php-scoper-prefix-remover/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Remove-Prefix-Patcher for PHP-Scoper
====================================

[](#remove-prefix-patcher-for-php-scoper)

[PHP-Scoper](https://github.com/humbug/php-scoper) Patcher for removing prefixes from global functions/classes/traits.

Installation
------------

[](#installation)

```
composer require --dev pxlrbt/php-scoper-prefix-remover
```

Usage
-----

[](#usage)

Import the required classes either manually or via composer autoloader:

```
require __DIR__ . '/vendor/autoload.php';

use pxlrbt\PhpScoper\PrefixRemover\IdentifierExtractor;
use pxlrbt\PhpScoper\PrefixRemover\RemovePrefixPatcher;
```

Extract the functions/classes/traits/interfaces you want the prefix removed from a stub file:

```
$identifiers = (new IdentifierExtractor())
  ->addStub('stub-file.php')
  ->extract();
```

Add the patcher in the patcher section of PHPScoper and pass the identifiers you extracted earlier:

```
'patchers' => [
    // Some patcher
    (new RemovePrefixPatcher($identifiers)),
    // More patchers
```

WordPress
---------

[](#wordpress)

For removing prefixes from WordPress functions/classes install [WordPress stubs](https://github.com/php-stubs/wordpress-stubs).

```
composer require --dev php-stubs/wordpress-stubs
```

Then add the stubs file to the extractor:

```
use pxlrbt\PhpScoper\PrefixRemover\IdentifierExtractor;

$identifiers = (new IdentifierExtractor())
  ->addStub('vendor/php-stubs/wordpress-stubs/wordpress-stubs.php')
  ->extract();
```

Specific PHP version
--------------------

[](#specific-php-version)

There might be issues with new reserved keywords (e.g. readonly as new keyword in PHP 8.1 and WordPress function name). You can set the targeted PHP version by providing a non default lexer like this:

```
use pxlrbt\PhpScoper\PrefixRemover\IdentifierExtractor;
use PhpParser\Lexer\Emulative;

$identifiers = (new IdentifierExtractor())
    ->addStub('vendor/php-stubs/wordpress-stubs/wordpress-stubs.php')
    ->setLexer(new Emulative(['phpVersion' => '8.0']))
    ->extract();
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~406 days

Total

2

Last Release

1630d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de2f0e928f16fab39bac058ab23744ed045a432404d1275a5a5258acbd368798?d=identicon)[pxlrbt](/maintainers/pxlrbt)

---

Top Contributors

[![pxlrbt](https://avatars.githubusercontent.com/u/22632550?v=4)](https://github.com/pxlrbt "pxlrbt (12 commits)")[![ssnepenthe](https://avatars.githubusercontent.com/u/10903810?v=4)](https://github.com/ssnepenthe "ssnepenthe (2 commits)")[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (2 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

### Embed Badge

![Health badge](/badges/pxlrbt-php-scoper-prefix-remover/health.svg)

```
[![Health](https://phpackages.com/badges/pxlrbt-php-scoper-prefix-remover/health.svg)](https://phpackages.com/packages/pxlrbt-php-scoper-prefix-remover)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M56](/packages/roave-backward-compatibility-check)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[recca0120/laravel-erd

Laravel ERD automatically generates Entity-Relationship Diagrams from your Laravel models and displays them using Vuerd.

36072.0k](/packages/recca0120-laravel-erd)[ondrejmirtes/better-reflection

Better Reflection - an improved code reflection API

136.2M4](/packages/ondrejmirtes-better-reflection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
