2017 © Pedro Peláez
 

library classproxy

image

tractorcow/classproxy

  • Sunday, June 17, 2018
  • by robbieaverill
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5,741 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 188 % Grown

The README.md

Partial proxy class builder

Build Status SilverStripe supported module, (*1)

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)

Installation

composer require tractorcow/classproxy

Examples

// 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'
]);

The Versions

17/06 2018

dev-master

9999999-dev

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

20/03 2018

0.1.2

0.1.2.0

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

16/02 2018

0.1.1

0.1.1.0

  Sources   Download

BSD-3-Clause

The Development Requires

16/02 2018

0.1.0

0.1.0.0

  Sources   Download

BSD-3-Clause

The Development Requires