<commit_before><?php
namespace JasperPHP;

use \JasperPHP;

/**
 * classe TLabel
 * classe para construÃ§Ã£o de rÃ³tulos de texto
 *
 * @author   <NAME> <<EMAIL>>
 * @version  2015.03.11
 * @access   restrict
 * 
 * 2015.03.11 -- criaÃ§Ã£o
 * */
class Subreport extends Element
{

    public $returnValues;

    public function generate($obj = null)
    {
        $this->returnValues = array();
        $row = is_object($obj) ? $_POST : $obj[1];
        $obj = is_array($obj) ? $obj[0] : $obj;
        $xmlFile = (string) $this->objElement->subreportExpression;
        $xmlFile = str_ireplace(array('"'), array(''), $xmlFile);
        //$rowArray =is_array($row)?$row:get_object_vars($row);
        if (is_array($row)) {
            $rowArray = $row;
        } elseif (is_object($row)) {
            if (method_exists($row, 'toArray')) {
                $rowArray = $row->toArray();
            } else {
                $rowArray = get_object_vars($row);
            }
        }
        $newParameters = ($rowArray) ? array_merge($obj->arrayParameter, $rowArray) : $obj->arrayParameter;
        //$GLOBALS['reports'][$xmlFile] = (array_key_exists($xmlFile, $GLOBALS['reports'])) ? $GLOBALS['reports'][$xmlFile] : new JasperPHP\Report($xmlFile);
        $report = new JasperPHP\Report($xmlFile, $newParameters); //$GLOBALS['reports'][$xmlFile];
        //$this->children= array($report);
        
        if ( preg_match("#^\\\$F{#", $this->objElement->dataSourceExpression) === 1 ) {
            $report->dbData = $obj->get_expression($this->objElement->dataSourceExpression,$row,null);
        }

        $report->generate(array());
        foreach ($this->objElement->returnValue as $r) {
            $this->returnValues[] = $r;
        }
        $obj->setReturnVariables($this, $report->arrayVariable);
    }
}

?><commit_msg>Update Subreport.php<commit_after><?php
namespace JasperPHP;

use \JasperPHP;

/**
 * classe TLabel
 * classe para construÃ§Ã£o de rÃ³tulos de texto
 *
 * @author   <NAME> <<EMAIL>>
 * @version  2015.03.11
 * @access   restrict
 * 
 * 2015.03.11 -- criaÃ§Ã£o
 * */
class Subreport extends Element
{

    public $returnValues;

    public function generate($obj = null)
    {
        $this->returnValues = array();
        $row = is_object($obj) ? $_POST : $obj[1];
        $obj = is_array($obj) ? $obj[0] : $obj;
        $xmlFile = (string) $this->objElement->subreportExpression;
        $xmlFile = str_ireplace(array('"'), array(''), $xmlFile);
        //$rowArray =is_array($row)?$row:get_object_vars($row);
        if (is_array($row)) {
            $rowArray = $row;
        } elseif (is_object($row)) {
            if (method_exists($row, 'toArray')) {
                $rowArray = $row->toArray();
            } else {
                $rowArray = get_object_vars($row);
            }
        }
        $newParameters = ($rowArray) ? array_merge($obj->arrayParameter, $rowArray) : $obj->arrayParameter;
        //$GLOBALS['reports'][$xmlFile] = (array_key_exists($xmlFile, $GLOBALS['reports'])) ? $GLOBALS['reports'][$xmlFile] : new JasperPHP\Report($xmlFile);
        $report = new JasperPHP\Report($xmlFile, $newParameters); //$GLOBALS['reports'][$xmlFile];
        //$this->children= array($report);
        
        if ( preg_match("#^\\\$F{#", $this->objElement->dataSourceExpression) === 1 ) {
            $report->dbData = $obj->get_expression($this->objElement->dataSourceExpression,$row,null);
        }

        $report->generate($obj?$obj:array());
        foreach ($this->objElement->returnValue as $r) {
            $this->returnValues[] = $r;
        }
        $obj->setReturnVariables($this, $report->arrayVariable);
    }
}

?>
{'fraction_non_alphanumeric': 0.1830296437313027, 'fraction_numerical': 0.010334511830296437, 'mean_word_length': 2.70392749244713, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, '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': '4965250', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1179, 'n_words': 199}