PHP code example of doekenorg / decorate-php

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

    

doekenorg / decorate-php example snippets




namespace My\Namespace;

use Package\Namespace\SomeInterface;

class DestinationClass implements SomeInterface {
    public function __construct(private SomeInterface $next) {
    }
    
    public function any_method(string $variable, ...$variadic_variable): void {
        $this->next->any_method($variable, ...$variadic_variable);
    }
}



namespace My\Namespace;

use Package\Namespace\ClientInterface;

class MyClient implements ClientInterface {
    public function __construct(private ClientInterface $client) {
    }

    // ...
}
bash
composer global