PHPackages                             sniccowp/php-scoper-excludes - 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. sniccowp/php-scoper-excludes

ActiveLibrary

sniccowp/php-scoper-excludes
============================

24514[2 PRs](https://github.com/snicco/php-scoper-excludes/pulls)PHP

Since Jan 24Pushed 3y ago2 watchersCompare

[ Source](https://github.com/snicco/php-scoper-excludes)[ Packagist](https://packagist.org/packages/sniccowp/php-scoper-excludes)[ RSS](/packages/sniccowp-php-scoper-excludes/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

A simple CLI tool to generate exclusion rules for PHP-Scoper.
=============================================================

[](#a-simple-cli-tool-to-generate-exclusion-rules-for-php-scoper)

You put in any PHP file and get out a several PHP files that contain a list of fully-namespaced:

- class names
- interface names
- trait names
- function names
- constant names

Example:
--------

[](#example)

Let's assume you have the following stub file:

```
namespace WP_CLI
{

    trait FooTrait
    {

    }

    class Autoloader
    {

        public function foo()
        {
        }

    }

    function foo_func()
    {
    }

    define('FOO', 'BAR');

    const BAZ = 'BIZ';
}

namespace WP_CLI\Utils
{

    function wp_not_installed()
    {
    }

    const BAM = 'boom';
}

namespace WP_CLI\Bootstrap
{

    interface BootstrapInterface
    {

    }

    trait BarTrait
    {

    }

    abstract class AutoloaderStep
    {

    }
}
```

The generated exclusion lists would be:

```
// exclude-wp-cli-classes.php
