<commit_before><?php
/*
 * Created by <NAME> on 2011-04-29.
 * Copyright (c) 2011 <NAME>.
 * All rights reserved.
 */

namespace InjectStack\Middleware;

use \SimpleXMLElement;

use \InjectStack\Request;
use \InjectStack\MiddlewareInterface;

/**
 * Converts any thrown exceptions into a 500 status which is passed to parent
 * middleware.
 */
class ShowException implements MiddlewareInterface
{
	/**
	 * The callback for the next middleware or the endpoint in this middleware
	 * stack.
	 * 
	 * @var \InjectStack\MiddlewareInterface|Closure|ObjectImplementing__invoke
	 */
	protected $next;
	
	// ------------------------------------------------------------------------
	
	/**
	 * Tells this middleware which middleware or endpoint it should call if it
	 * wants the call-chain to proceed.
	 * 
	 * @param  \InjectStack\MiddlewareInterface|Closure|ObjectImplementing__invoke
	 */
	public function setNext($next)
	{
		$this->next = $next;
	}
	
	// ------------------------------------------------------------------------<commit_msg>Middleware\ShowException: Fixed PHPdoc header for class<commit_after><?php
/*
 * Created by <NAME> on 2011-04-29.
 * Copyright (c) 2011 <NAME>.
 * All rights reserved.
 */

namespace InjectStack\Middleware;

use \SimpleXMLElement;

use \InjectStack\Request;
use \InjectStack\MiddlewareInterface;

/**
 * Takes any thrown exception and prints the exception and stack trace,
 * supports html, json and xml depending on Accept header.
 */
class ShowException implements MiddlewareInterface
{
	/**
	 * The callback for the next middleware or the endpoint in this middleware
	 * stack.
	 * 
	 * @var \InjectStack\MiddlewareInterface|Closure|ObjectImplementing__invoke
	 */
	protected $next;
	
	// ------------------------------------------------------------------------
	
	/**
	 * Tells this middleware which middleware or endpoint it should call if it
	 * wants the call-chain to proceed.
	 * 
	 * @param  \InjectStack\MiddlewareInterface|Closure|ObjectImplementing__invoke
	 */
	public function setNext($next)
	{
		$this->next = $next;
	}
	
	// ------------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.21973929236499068, 'fraction_numerical': 0.012569832402234637, 'mean_word_length': 2.1556534508076357, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '2973142', 'n_tokens_mistral': 592, 'n_tokens_neox': 548, 'n_words': 171}