PHP code example of brightmachine / object-proxy

1. Go to this page and download the library: Download brightmachine/object-proxy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brightmachine / object-proxy example snippets


 namespace Example;

use Monolog\Logger;
use BrightMachine\ObjectWrapper;

/**
 * Class Logger
 *
 * Proxy requests to Monolog/Logger
 *
 * @method mixed logMessage($msg) add a debug message
 * @package Example\Logger
 */
class Logger
{
    use ObjectWrapper;

    public function __construct ()
    {
        $target = new Logger('dev', $this->app['events']);
        $this->setTargetObject($target)
             ->setProxyFunctionMap([
                 'logMessage' => 'addDebug'
             ]);
    }
}

php composer.phar install