🌈 OOP Proxy wrappers utilities - generates and manages proxies of your objects
PHP CSS Other
Ocramius Merge pull request #417 from Ocramius/enhacement/use-proper-visibility
Use proper visibility when overwriting `TestCase#setUp()`
Latest commit 99542a2 Jun 8, 2018
Permalink
Failed to load latest commit information.
doc-template Docs: Fix mixed content loading Jun 27, 2017
docs Using newer (working) presentation link May 14, 2018
examples #272 - Example of ghost object skipped properties Jan 28, 2016
html-docs Redirecting to new documentation URIs in `html-docs` (to be removed i… Mar 19, 2015
src/ProxyManager `getWrappedValueHolderValue` should always have a return type of `?ob… Nov 15, 2017
tests Make overwrites of `TestCase#setUp()` be compatible with the parent v… Jun 8, 2018
.gitattributes #361 excluding humbug and phpbench config from built package Feb 19, 2017
.gitignore Rollback gitignore Oct 9, 2017
.scrutinizer.yml Remove php 7.x from allowed failure Apr 8, 2015
.travis.coverage.sh Uploading coverage when the PHP version matches 7.2 Nov 15, 2017
.travis.install.sh Simplifying travis installation steps, since HHVM is no longer part o… Nov 15, 2017
.travis.yml Couscous also needs to run when the PHP version matches 7.2 Nov 15, 2017
CHANGELOG.md ProxyManager 2.2.0 release notes Nov 16, 2017
CONTRIBUTING.md Tidied up contributing doc May 12, 2018
LICENSE EOF EOL Sep 23, 2014
README.md Tidied up the docs and simply removed weasel words May 12, 2018
STABILITY.md extend date for bug fixes and security fixes for 2.0.x version Jan 3, 2017
UPGRADE.md #272 - PHP 4 constructors are no longer supported Jan 28, 2016
composer.json Upgraded PHPStan version, ensured the test suite passes even with moc… Nov 16, 2017
couscous.yml Correcting couscous base directory Mar 19, 2015
humbug.json.dist Added humbug configuration Nov 20, 2016
phpbench.json Aggregate report is usually what is needed Jul 1, 2016
phpdox.xml.dist EOF EOL fixes Sep 23, 2014
phpmd.xml.dist EOF EOL fixes Sep 23, 2014
phpstan.neon #361 removed workaround for phpstan/phpstan#152 Feb 21, 2017
phpstan.tests.neon Upgraded PHPStan version, ensured the test suite passes even with moc… Nov 16, 2017
phpunit.xml.dist Moved deprecated phpunit flags to phpunit config Oct 8, 2017
proxy-manager.png Including rasterized version of the logo (renders on github) Nov 9, 2013
proxy-manager.svg Removing licence also from the logo Jul 31, 2017

README.md

Proxy Manager

This library aims to provide abstraction for generating various kinds of proxy classes.

ProxyManager

Build Status Code Coverage Scrutinizer Quality Score SensioLabsInsight Dependency Status Reference Status

Total Downloads Latest Stable Version Latest Unstable Version

Documentation

You can learn about the proxy pattern and how to use the ProxyManager in the docs, which are also compiled to HTML.

Help/Support

Gitter

Installation

The suggested installation method is via composer:

php composer.phar require ocramius/proxy-manager

Proxy example

Here's how you build a lazy loadable object with ProxyManager using a Virtual Proxy

$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory();

$proxy = $factory->createProxy(
    \MyApp\HeavyComplexObject::class,
    function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {
        $wrappedObject = new \MyApp\HeavyComplexObject(); // instantiation logic here
        $initializer   = null; // turning off further lazy initialization
    }
);

$proxy->doFoo();

See the online documentation for more supported proxy types and examples.