PHP code example of divsmith / airlock

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

    

divsmith / airlock example snippets


    interface ExampleInterface {
        public function method1($args);
        public function method2($args);
        etc...
    }
    

    class ExampleInterfaceAdapter extends \Airlock\Airlock implements ExampleInterface {

        public function method1($args)
        {
            return $this->delegate(__FUNCTION__, func_get_args());
        }

        public function method2($args)
        {
            return $this->delegate(__FUNCTION__, func_get_args());
        }

    }
    

    return $this->delegate(__FUNCTION__, func_get_args());
    

    $adapter = new ExampleInterfaceAdapter(new ConcreteDependency());
    

    class ExampleInterfaceAdapter extends\Airlock\Airlock implements ExampleInterface {

        public function __construct(\Namespace\ConcreteDependency $dependency)
        {
            $this->locker = $dependency;
        }

        ...
    }
    

interface ExampleInterface {};

class ExampleAdapter extends \Airlock\Airlock implements ExampleInterface{
    
    public function __construct(\Namespace\ConcreteDependency $dependency)
    {
        $this->locker = $dependency;
    }
}