PHPackages                             sebk/small-class-manipulator - 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. sebk/small-class-manipulator

Abandoned → [small/class-manipulator](/?search=small%2Fclass-manipulator)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

sebk/small-class-manipulator
============================

1.0.0(3y ago)010PHPPHP &gt;=8.1

Since Jan 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/sebk69/small-class-manipulator)[ Packagist](https://packagist.org/packages/sebk/small-class-manipulator)[ RSS](/packages/sebk-small-class-manipulator/feed)WikiDiscussions main Synced 1mo ago

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

small-class-manipulator
=======================

[](#small-class-manipulator)

This lib allow you to read and parse a php file containing class into a php object.

You can then easily add or remove components and rewrite file with modifications.

Migrated
========

[](#migrated)

This lib has been migrated to [framagit](https://framagit.org/small/small-projects) project.

A new composer package is available at

Future commits will be done on framagit.

This repository will be removed in few month.

Parsing and generating classes
------------------------------

[](#parsing-and-generating-classes)

### Manipulator instanciation

[](#manipulator-instanciation)

To parse a class, you must instanciate ClassManipulator :

```
$classManipulator = new ClassManipulator([
        'rootDir' => __DIR__ . '/../data',
        'selectors' => [
            'test' => [
                'testing' => [
                    'namespace' => 'DataTest\Testing',
                    'path' => 'DataTest',
                ], 'empty' => [
                    'namespace' => 'Empty',
                    'path' => 'Empty',
                ],
            ]
        ],
    ]);
```

The "rootDir" parameter is your "src" directory.

The selectors allow you to isolate namespaces params by categories. Here we have injecting only a "test" selector.

In the test selector, we have as many of namespaces we want and each namespace must contain a namespace and corresponding directory path.

### Parsing

[](#parsing)

You can now parse a class :

```
$classFile = $this->classManipulator->getClass('test', \Empty\Testing\TestClass::class);
```

This will return a ClassFile

Unit test
---------

[](#unit-test)

To run unit tests, you are required to install docker and docker-compose :

```
$ apt-get install docker docker-compose
```

Then go to root of lib and run :

```
$ docker-compose up -d --build
```

If the tests fail the command will return an error.

In development, you can set argument "BUILD" to 0 in docker-compose.yml, then the container will not stop, allow you to run tests using :

```
$ bin/test
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45cdb3e169cfc71f586543af872d5a48416b21c4ebb43060bcb8c96eebf3ff5d?d=identicon)[sebk69](/maintainers/sebk69)

---

Top Contributors

[![sebk69](https://avatars.githubusercontent.com/u/6600508?v=4)](https://github.com/sebk69 "sebk69 (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebk-small-class-manipulator/health.svg)

```
[![Health](https://phpackages.com/badges/sebk-small-class-manipulator/health.svg)](https://phpackages.com/packages/sebk-small-class-manipulator)
```

PHPackages © 2026

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