PHP code example of jdwx / iproxy

1. Go to this page and download the library: Download jdwx/iproxy 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/ */

    

jdwx / iproxy example snippets





interface IFoo {


    public function bar() : baz;


}





trait TFooProxy {


    private IFoo $proxyFoo;


    public function bar() : baz {
        return $this->proxyFoo->bar();
    }


    protected function setProxyFoo( IFoo $i_proxyFoo ) : void {
        $this->proxyFoo = $i_proxyFoo;
    }


}




class DecoratedFoo implements IFoo {


    use TFooProxy;
    
    
    public function __construct( IFoo $i_foo ) {
        $this->setProxyFoo( $i_foo );
    }
    
    
    public function alsoDoesQux() : void {
        // ... whatever ...
    }


}
bash
YourPrompt$ vendor/bin/iproxy.php IFoo.php >FooProxy.php