public static function createFromStatics(array $statics)
    {
        $mode = false;

        if (isset($statics['enabled_mode'])) {
            $mode = $statics['enabled_mode'];

            if (true === $statics['enabled_mode'] && isset($statics['mode_default'])) {
                $mode = $statics['mode_default'];

                if (PHP_SAPI === 'cli' && !empty($statics['cli_detection']) && isset($statics['mode_default_cli'])) {
                    $mode = $statics['mode_default_cli'];
                }
            }
        }

        if (!$mode) {
            return null;
        }

        if (!isset($statics['renderers'][$mode])) {
            $renderer = new TextRenderer();
        } else {
            /** @var Renderer */
            $renderer = new $statics['renderers'][$mode]();
        }

        return new self(new Parser(), $renderer);
    }
public static function createFromStatics(array $statics)
    {
        $mode = false;

        if (isset($statics['enabled_mode'])) {
            $mode = $statics['enabled_mode'];

            if (true === $statics['enabled_mode'] && isset($statics['mode_default'])) {
                $mode = $statics['mode_default'];

                if (PHP_SAPI === 'cli' && !empty($statics['cli_detection']) && isset($statics['mode_default_cli'])) {
                    $mode = $statics['mode_default_cli'];
                }
            }
        }

        if (!$mode) {
            return null;
        }

        if (!isset($statics['renderers'][$mode])) {
            $renderer = new TextRenderer();
        } else {
            /** @var Renderer */
            $renderer = new $statics['renderers'][$mode]();
        }

        return new self(new Parser(), $renderer);
    }
public static function createFromStatics ( array $ statics ) { $ mode = false ; if ( isset ( $ statics [ 'enabled_mode' ] ) ) { $ mode = $ statics [ 'enabled_mode' ] ; if ( true === $ statics [ 'enabled_mode' ] && isset ( $ statics [ 'mode_default' ] ) ) { $ mode = $ statics [ 'mode_default' ] ; if ( PHP_SAPI === 'cli' && ! empty ( $ statics [ 'cli_detection' ] ) && isset ( $ statics [ 'mode_default_cli' ] ) ) { $ mode = $ statics [ 'mode_default_cli' ] ; } } } if ( ! $ mode ) { return null ; } if ( ! isset ( $ statics [ 'renderers' ] [ $ mode ] ) ) { $ renderer = new TextRenderer ( ) ; } else { /** @var Renderer */ $ renderer = new $ statics [ 'renderers' ] [ $ mode ] ( ) ; } return new self ( new Parser ( ) , $ renderer ) ; }
Creates a Kint instances based on static settings.

Also calls setStatesFromStatics for you

@param array $statics array of statics as returned by getStatics

@return null|\Kint\Kint
Creates a Kint instances based on static settings .