Kahlan\Box\Wrapper::__construct PHP Method

__construct() public method

The constructor
public __construct ( array $config = [] )
$config array The config array. Possible values are: - `'box'` _object_: The box instance (required). - `'name'` _string_: The name of the dependency definition. - `'params'` _array_ : The parameters to use for resolving the dependency.
    public function __construct($config = [])
    {
        $defaults = ['box' => null, 'name' => null, 'params' => []];
        $config += $defaults;
        $this->__box = $config['box'];
        $this->__name = $config['name'];
        $this->__params = $config['params'];
        if (!$this->__box || !$this->__name) {
            throw new BoxException("Error, the wrapper require at least `'box'` & `'name'` to not be empty.");
        }
    }