ocramius/proxy-manager
ProxyManager generates and manages PHP proxy classes (virtual proxies, lazy-loading value holders, etc.) to implement the Proxy Pattern. Useful for lazy-loading, interceptors, and advanced DI/ORM scenarios. Install via Composer and use factory helpers to create proxies.
ProxyManager allows you to generate classes based on generator strategies and a given Laminas\Code\Generator\ClassGenerator as of the interface of a generator strategy.
Currently, 3 generator strategies are shipped with ProxyManager:
ProxyManager\GeneratorStrategy\BaseGeneratorStrategy
which retrieves the string representation of the class from ClassGeneratorProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy
which calls eval() upon the generated class code before returning it. This is useful in cases where you want to generate
multiple classes at runtimeProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy
which accepts a
ProxyManager\FileLocator\FileLocatorInterface
instance as constructor parameter, and based on it, writes the generated class to a file before returning its code.How can I help you explore Laravel packages today?