src/Reporter/Coverage/Exporter/Istanbul.php
public static function export($options)
    {
        $defaults = [
            'collector' => null,
            'base_path' => getcwd()
        ];
        $options += $defaults;

        $collector = $options['collector'];

        $export = [];

        $base = $options['base_path'] ? rtrim($options['base_path'], DS) . DS : '';

        foreach ($collector->export() as $file => $coverage) {
            $path = $base . $file;
            $export[$path] = static::_export($path, $collector->parse($file), $coverage);
        }

        return json_encode($export);
    }
public static function export($options)
    {
        $defaults = [
            'collector' => null,
            'base_path' => getcwd()
        ];
        $options += $defaults;

        $collector = $options['collector'];

        $export = [];

        $base = $options['base_path'] ? rtrim($options['base_path'], DS) . DS : '';

        foreach ($collector->export() as $file => $coverage) {
            $path = $base . $file;
            $export[$path] = static::_export($path, $collector->parse($file), $coverage);
        }

        return json_encode($export);
    }
public static function export ( $ options ) { $ defaults = [ 'collector' => null , 'base_path' => getcwd ( ) ] ; $ options += $ defaults ; $ collector = $ options [ 'collector' ] ; $ export = [ ] ; $ base = $ options [ 'base_path' ] ? rtrim ( $ options [ 'base_path' ] , DS ) . DS : '' ; foreach ( $ collector -> export ( ) as $ file => $ coverage ) { $ path = $ base . $ file ; $ export [ $ path ] = static :: _export ( $ path , $ collector -> parse ( $ file ) , $ coverage ) ; } return json_encode ( $ export ) ; }
Exports a coverage to a Istanbul compatible JSON format.

@param  array  $options The option array where the possible values are:
-`'collector'`      _object_ : The collector instance.
@return string
Exports a coverage to a Istanbul compatible JSON format .