Kahlan\Reporter\Coverage::__construct PHP Method

__construct() public method

The Constructor.
public __construct ( array $config = [] )
$config array The config for the reporter, the options are: - `'verbosity`' _integer|string_: The verbosity level: - 1 : overall coverage value for the whole code. - 2 : overall coverage by namespaces. - 3 : overall coverage by classes. - 4 : overall coverage by methods and functions. - string : coverage for a fully namespaced (class/method/namespace) string.
    public function __construct($config = [])
    {
        parent::__construct($config);
        $defaults = ['verbosity' => 1];
        $config += $defaults;
        $verbosity = $config['verbosity'];
        $this->_verbosity = is_numeric($verbosity) ? (int) $verbosity : (string) $verbosity;
        if (is_string($this->_verbosity)) {
            $class = preg_replace('/(::)?\\w+\\(\\)$/', '', $this->_verbosity);
            $interceptor = static::$_classes['interceptor'];
            $loader = $interceptor::instance();
            if ($loader && ($path = $loader->findPath($class))) {
                $config['path'] = $path;
            }
        }
        $this->_collector = new Collector($config);
    }