<commit_before><?php
/**
 *	This file is a part of the Sophwork project
 *	@version : Sophwork.0.3.0
 *	@author : Syu93
 *	--
 *	Main ErrorHandler class
 *	
 *	Service provider - Must containt (init) method
 *	and must return its application name
 */
namespace Sophwork\modules\handlers\errors\errorHandler;

use Sophwork\app\app\SophworkApp;
use Sophwork\modules\handlers\errors\exception\SophworkErrorException;
use Sophwork\modules\ServiceProviders\ServiceProviderInterface\ServiceProviderInterface;

class ErrorHandler implements ServiceProviderInterface
{
	protected $customMessage;

	public function init (SophworkApp $app, Array $parameters = []) {
		if ($app->debug) {
			error_reporting(E_ALL|E_STRICT);
			ini_set('display_errors', $app->debug?1:0);

			set_error_handler([$this, "errorHandler"]);
			set_exception_handler([$this, "exceptionHandler"]);

			// $this->customMessage = $customMessage;
		}

		return 'ErrorHandler';
	}

	public function errorHandler($severity, $message, $file, $line) {
		//FIXME : chech all case
	    switch ($severity) {
	        case E_NOTICE:
	        case E_USER_NOTICE:<commit_msg>[clean] remove customMessage from errorhandler init<commit_after><?php
/**
 *	This file is a part of the Sophwork project
 *	@version : Sophwork.0.3.0
 *	@author : Syu93
 *	--
 *	Main ErrorHandler class
 *	
 *	Service provider - Must containt (init) method
 *	and must return its application name
 */
namespace Sophwork\modules\handlers\errors\errorHandler;

use Sophwork\app\app\SophworkApp;
use Sophwork\modules\handlers\errors\exception\SophworkErrorException;
use Sophwork\modules\ServiceProviders\ServiceProviderInterface\ServiceProviderInterface;

class ErrorHandler implements ServiceProviderInterface
{

	public function init (SophworkApp $app, Array $parameters = []) {
		if ($app->debug) {
			error_reporting(E_ALL|E_STRICT);
			ini_set('display_errors', $app->debug?1:0);

			set_error_handler([$this, "errorHandler"]);
			set_exception_handler([$this, "exceptionHandler"]);
		}

		return 'ErrorHandler';
	}

	public function errorHandler($severity, $message, $file, $line) {
		//FIXME : chech all case
	    switch ($severity) {
	        case E_NOTICE:
	        case E_USER_NOTICE:
{'fraction_non_alphanumeric': 0.11626858945470933, 'fraction_numerical': 0.006309148264984227, 'mean_word_length': 4.606060606060606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '6346401', 'n_tokens_mistral': 737, 'n_tokens_neox': 688, 'n_words': 158}