dev-master
9999999-dev
BSD-3-Clause
The Requires
The Development Requires
0.1.2
0.1.2.0
BSD-3-Clause
The Requires
The Development Requires
0.1.1
0.1.1.0
BSD-3-Clause
The Development Requires
0.1.0
0.1.0.0
BSD-3-Clause
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Dynamically scaffold proxy classes that actually extend the class being proxied, allowing them to be used in type-strict applications., (*2)
No it's not prophecy because this is designed for partial proxies, not testing., (*3)
composer require tractorcow/classproxy
// Create a proxy creator
$proxy = ProxyFactory::create(DataBase::class)
->addMethod('connect', function ($args, $next) use ($logger) {
$logger->log("Connecting to server " . $args[0]['server'];
return $next(...$args);
});
// Generate instance of our proxy
$instance = $proxy->instance();
assert($instance instanceof Database); // Yep!
// Connects to underlying database, logging the call
$instance->connect([
'server' => 'localhost',
'user' => 'root'
]);
BSD-3-Clause
BSD-3-Clause
BSD-3-Clause
BSD-3-Clause