<commit_before><?php
#replacement functions for OFC charts - Google Charts API - simpilot
#load Google Chart Wrapper library (3rd party)
require CORE_LIB_PATH . '/gChart/gChart.php';

class ChartsData extends CodonData    {

        public static function build_pireptable($pilotid, $days = '30', $color= '000000', $background = 'EFEFEF', $width = '950', $height = '260')   {

            #make sure $days is even - if not add 1
            if($days&1){$days++;}

            $output = array();
            #set current date
            $month = date("m");
            $day = date("d");
            $year = date("Y");
            #set todays date
            $output[] = date('m-d',mktime(0,0,0,$month,($day),$year));
            #loop through days
            for($i=1; $i<=($days-1); $i++){
                    $output[] = date('m-d',mktime(0,0,0,$month,($day-$i),$year));
            }
            #reverse the days for chart
            $output = array_reverse($output);

            #set baseline values
            $labels = array();
            $points = array();
            $xTotal = 0;
            $yTotal = 0;
            $dataPoint = array();
            $data = PIREPData::getIntervalDataByDays(array('p.pilotid'=>$pilotid), $days);

            if($data)   {
                foreach($data as $dat)  {

                    $points[] = $dat->total;
                    #get highest y-axis value for chart
                    if($dat->total > $total)    {
                        $yTotal = $dat->total;
                    }
                    $date = '';
                    $date = explode('-', $dat->ym);
                    $labels[] = $date[1].'-'.$date[2];
                    $xTotal++;

                    $z = '';
                    $z->label = $date[1].'-'.$date[2];
                    $z->point = $dat->total;
                    $dataPoint[] = $z;
                }
            }

            $fLabels = array();
            $fPoints = array();
            $arraySpot = '0';<commit_msg>php 5.5 stdClass fix (line 49)<commit_after><?php
#replacement functions for OFC charts - Google Charts API - simpilot
#load Google Chart Wrapper library (3rd party)
require CORE_LIB_PATH . '/gChart/gChart.php';

class ChartsData extends CodonData    {

        public static function build_pireptable($pilotid, $days = '30', $color= '000000', $background = 'EFEFEF', $width = '950', $height = '260')   {

            #make sure $days is even - if not add 1
            if($days&1){$days++;}

            $output = array();
            #set current date
            $month = date("m");
            $day = date("d");
            $year = date("Y");
            #set todays date
            $output[] = date('m-d',mktime(0,0,0,$month,($day),$year));
            #loop through days
            for($i=1; $i<=($days-1); $i++){
                    $output[] = date('m-d',mktime(0,0,0,$month,($day-$i),$year));
            }
            #reverse the days for chart
            $output = array_reverse($output);

            #set baseline values
            $labels = array();
            $points = array();
            $xTotal = 0;
            $yTotal = 0;
            $dataPoint = array();
            $data = PIREPData::getIntervalDataByDays(array('p.pilotid'=>$pilotid), $days);

            if($data)   {
                foreach($data as $dat)  {

                    $points[] = $dat->total;
                    #get highest y-axis value for chart
                    if($dat->total > $total)    {
                        $yTotal = $dat->total;
                    }
                    $date = '';
                    $date = explode('-', $dat->ym);
                    $labels[] = $date[1].'-'.$date[2];
                    $xTotal++;

                    $z = new stdClass();
                    $z->label = $date[1].'-'.$date[2];
                    $z->point = $dat->total;
                    $dataPoint[] = $z;
                }
            }

            $fLabels = array();
            $fPoints = array();
            $arraySpot = '0';
{'fraction_non_alphanumeric': 0.16103575832305794, 'fraction_numerical': 0.016769420468557335, 'mean_word_length': 1.3526682134570767, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3723488', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1142, 'n_words': 268}