<commit_before><?php
/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 12/8/2015
 * Time: 9:45 PM
 */

namespace lillockey\Utilities\App\Access\ObjectAccess;


use lillockey\Utilities\App\Access\Helpers\JsonErrorReportable;
use lillockey\Utilities\App\InstanceHolder;

class JsonObject extends AccessibleObject implements JsonErrorReportable
{
	private $json_error = null;
	private $json_error_msg = null;

	public function __construct($json)
	{
		$util = InstanceHolder::util();
		if($util->is_json($json)) {
			parent::__construct(json_decode($json));
			$this->json_error = json_last_error();
			$this->json_error_msg = json_last_error_msg();
		} else {
			parent::__construct(new \stdClass());
		}
	}

	public function getJsonError()
	{
		return $this->json_error;
	}

	public function getJsonErrorMessage()
	{
		return $this->json_error_msg;
	}
}<commit_msg>Fixed warning for json decoding in jsonobject creation<commit_after><?php
/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 12/8/2015
 * Time: 9:45 PM
 */

namespace lillockey\Utilities\App\Access\ObjectAccess;


use lillockey\Utilities\App\Access\Helpers\JsonErrorReportable;
use lillockey\Utilities\App\InstanceHolder;

class JsonObject extends AccessibleObject implements JsonErrorReportable
{
	private $json_error = null;
	private $json_error_msg = null;

	public function __construct($json)
	{
		$util = InstanceHolder::util();
		if($util->is_json($json)) {
			parent::__construct($std = json_decode($json));
			$this->json_error = json_last_error();
			$this->json_error_msg = json_last_error_msg();
		} else {
			parent::__construct($std = new \stdClass());
		}
	}

	public function getJsonError()
	{
		return $this->json_error;
	}

	public function getJsonErrorMessage()
	{
		return $this->json_error_msg;
	}
}
{'fraction_non_alphanumeric': 0.13206491326245104, 'fraction_numerical': 0.01119194180190263, 'mean_word_length': 4.920529801324503, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '416598', 'n_tokens_mistral': 646, 'n_tokens_neox': 605, 'n_words': 115}