kohkimakimoto/static-proxy

StaticProxy provides static interface to an instance method.

v0.1.0 2014-08-04 04:34 UTC

This package is auto-updated.

Last update: 2024-05-06 22:21:48 UTC


README

Build Status

StaticProxy provides static interface to an instance method. It's heavily inspired by the Facades of Laravel.

Requirement

PHP5.3 or later.

Installation

You can use composer installation. Make composer.json file like the following.

{
      "require": {
          "kohkimakimoto/static-proxy": "0.*"
      }
}

And run composer install command.

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install

Usage

<?php
use Kohkimakimoto\StaticProxy\StaticProxy;
use Kohkimakimoto\StaticProxy\StaticProxyContainer;

$container = new StaticProxyContainer();
$container->bind("hello", new HelloworldFunctions());

StaticProxy::setContainer($container);
StaticProxy::addAlias("Hw", "Test\Kohkimakimoto\StaticProxy\Helloworld");

Hw::helloWorld();

Author

Kohki Makimoto kohki.makimoto@gmail.com

License

MIT