<commit_before><?php
/**
 * @version     $Id$
 * @package     Nooku_Server
 * @subpackage  Articles
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Error Json View Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku_Server
 * @subpackage  Articles
 */

class ComApplicationViewErrorJson extends KViewJson
{
    public function display()
    {
        if(ini_get('display_errors')) {
            $message = (string) $this->error;
        } else {
            $message = KHttpResponse::getMessage($this->error->getCode());
        }

        $properties = array(
            'message' => $message,
            'code'    => $this->error->getCode()
        );

        if(ini_get('display_errors')) {
        {
            $properties['data'] = array(
                'file'	    => $this->error->getFile(),
                'line'      => $this->error->getLine(),
                'function'  => $this->error->getFunction(),
                'class'		=> $this->error->getClass(),
                'args'		=> $this->error->getArgs(),
                'info'		=> $this->error->getInfo()
            );
        }

        $this->output = json_encode(array(
            'version'  => '1.0',
            'errors' => array($properties)
        ));

        return parent::display();
    }
}<commit_msg>Fix typo. re #228<commit_after><?php
/**
 * @version     $Id$
 * @package     Nooku_Server
 * @subpackage  Articles
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Error Json View Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku_Server
 * @subpackage  Articles
 */

class ComApplicationViewErrorJson extends KViewJson
{
    public function display()
    {
        if(ini_get('display_errors')) {
            $message = (string) $this->error;
        } else {
            $message = KHttpResponse::getMessage($this->error->getCode());
        }

        $properties = array(
            'message' => $message,
            'code'    => $this->error->getCode()
        );

        if(ini_get('display_errors'))
        {
            $properties['data'] = array(
                'file'	    => $this->error->getFile(),
                'line'      => $this->error->getLine(),
                'function'  => $this->error->getFunction(),
                'class'		=> $this->error->getClass(),
                'args'		=> $this->error->getArgs(),
                'info'		=> $this->error->getInfo()
            );
        }

        $this->output = json_encode(array(
            'version'  => '1.0',
            'errors' => array($properties)
        ));

        return parent::display();
    }
}
{'fraction_non_alphanumeric': 0.1686626746506986, 'fraction_numerical': 0.0083166999334664, 'mean_word_length': 1.8367924528301887, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '824748', 'n_tokens_mistral': 952, 'n_tokens_neox': 916, 'n_words': 157}