Kahlan\Reporter\Bar::__construct PHP Method

__construct() public method

Constructor
public __construct ( array $config = [] )
$config array The config array.
    public function __construct($config = [])
    {
        parent::__construct($config);
        $defaults = ['size' => 50, 'preferences' => ['passed' => 'green', 'failed' => 'red'], 'chars' => ['bar' => '=', 'indicator' => '>'], 'format' => '[{:b}{:i}] {:p}%'];
        $config += $defaults;
        $config['chars'] += $defaults['chars'];
        $config['preferences'] += $defaults['preferences'];
        foreach ($config as $key => $value) {
            $_key = "_{$key}";
            $this->{$_key} = $value;
        }
        $this->_color = $this->_preferences['passed'];
    }