PHPackages                             spoova/ghost - 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. spoova/ghost

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

spoova/ghost
============

A GhostProxy class for anonymous objects.

v1.0.0(1mo ago)011MITPHP

Since Jun 10Pushed 1w agoCompare

[ Source](https://github.com/teymzz/Ghost)[ Packagist](https://packagist.org/packages/spoova/ghost)[ RSS](/packages/spoova-ghost/feed)WikiDiscussions main Synced 1w ago

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

Ghost
=====

[](#ghost)

Ghost is a small PHP utility for creating dynamic, proxy-backed objects without needing a concrete class upfront. The package is centered around four components:

- GhostFunction: defines dynamic methods and properties using closures and simple array definitions.
- GhostDraft: a lightweight bridge that exposes the proxy id and the underlying GhostFunction payload.
- GhostProxy: creates a proxy object and maps it to a concrete class or anonymous object.
- GhostClass: a convenience base class that automatically performs the GhostProxy mapping and exposes a protected proxy object for initialization.

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

[](#installation)

```
composer require spoova/ghost
```

```
