PHP code example of reliese / component-dependency

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

    

reliese / component-dependency example snippets


/**
 * @param string $dependency
 * @param Closure $abstraction
 *
 * @return Container
 */
public function singleton(string $dependency, Closure $abstraction) : Container;

/**
 * @param string $dependency
 * @param Closure $abstraction
 *
 * @return Container
 */
public function register(string $dependency, Closure $abstraction) : Container;

/**
 * @param string $dependency
 *
 * @return mixed
 * @throws UnresolvableDependencyException
 */
public function resolve(string $dependency);

/**
 * @param object $object
 * @param string $method
 *
 * @return mixed
 * @throws UnresolvableDependencyException
 */
public function call(object $object, string $method);