public/phpmyadmin/vendor/codacy/coverage/src/Codacy/Coverage/Util/JsonProducer.php
/**
     * Takes a CoverageReport object, the result of makeReport(), and outputs JSON.
     * Example JSON format:
     * {
     *  "total": 67,
     *  "fileReports": [
     *       {
     *          "filename": "src/Codacy/Coverage/Api/Api.php",
     *          "total": 3,
     *          "coverage": {
     *              "12": 3,
     *              "13": 5,
     *              .........
     *              .........
     *          }
     *      },
     *      .........
     *      .......
     *  ]
     * }
     *
     * @return string the JSON string
     */
Takes a CoverageReport object, the result of makeReport(), and outputs JSON.

@return string the JSON string
Takes a CoverageReport object the result of makeReport () and outputs JSON . @return string the JSON string
public function makeJson()
    {
        $report = $this->makeReport();
        $array = array();
        $array['total'] = $report->getTotal();
        $fileReportsArray = array();
        $fileReports = $report->getFileReports();
        foreach ($fileReports as $fr) {
            $fileArray = array();
            $fileArray['filename'] = $fr->getFileName();
            $fileArray['total'] = $fr->getTotal();
            $fileArray['coverage'] = $fr->getLineCoverage();
            array_push($fileReportsArray, $fileArray);
        }
        $array['fileReports'] = $fileReportsArray;
        if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
            return json_encode($array, JSON_UNESCAPED_SLASHES);
        } else {
            return str_replace('\/', '/', json_encode($array));
        }
    }
public function makeJson ( ) { $ report = $ this -> makeReport ( ) ; $ array = array ( ) ; $ array [ 'total' ] = $ report -> getTotal ( ) ; $ fileReportsArray = array ( ) ; $ fileReports = $ report -> getFileReports ( ) ; foreach ( $ fileReports as $ fr ) { $ fileArray = array ( ) ; $ fileArray [ 'filename' ] = $ fr -> getFileName ( ) ; $ fileArray [ 'total' ] = $ fr -> getTotal ( ) ; $ fileArray [ 'coverage' ] = $ fr -> getLineCoverage ( ) ; array_push ( $ fileReportsArray , $ fileArray ) ; } $ array [ 'fileReports' ] = $ fileReportsArray ; if ( version_compare ( PHP_VERSION , '5.4.0' , '>=' ) ) { return json_encode ( $ array , JSON_UNESCAPED_SLASHES ) ; } else { return str_replace ( '\/' , '/' , json_encode ( $ array ) ) ; } }
Takes a CoverageReport object, the result of makeReport(), and outputs JSON.
Takes a CoverageReport object the result of makeReport () and outputs JSON .