<commit_before><?php
/**
 * @author hollodotme
 */

namespace Fortuneglobe\IceHawk\Routing;

use Fortuneglobe\IceHawk\Interfaces\RoutesToHandler;
use Fortuneglobe\IceHawk\Routing\Exceptions\RoutesAreNotTraversable;

/**
 * Class AbstractRouter
 * @package Fortuneglobe\IceHawk\Routing
 */
abstract class AbstractRouter
{
	/** @var array|\Traversable */
	private $routes;

	/**
	 * @param array|\Traversable $routes
	 */
	public function __construct( $routes )
	{
		$this->guardRoutesAreTraversable( $routes );

		$this->routes = $routes;
	}

	/**
	 * @param mixed $routes
	 *
	 * @throws RoutesAreNotTraversable
	 */
	private function guardRoutesAreTraversable( $routes )
	{<commit_msg>fix typehint<commit_after><?php
/**
 * @author hollodotme
 */

namespace Fortuneglobe\IceHawk\Routing;

use Fortuneglobe\IceHawk\Routing\Interfaces\RoutesToHandler;
use Fortuneglobe\IceHawk\Routing\Exceptions\RoutesAreNotTraversable;

/**
 * Class AbstractRouter
 * @package Fortuneglobe\IceHawk\Routing
 */
abstract class AbstractRouter
{
	/** @var array|\Traversable */
	private $routes;

	/**
	 * @param array|\Traversable $routes
	 */
	public function __construct( $routes )
	{
		$this->guardRoutesAreTraversable( $routes );

		$this->routes = $routes;
	}

	/**
	 * @param mixed $routes
	 *
	 * @throws RoutesAreNotTraversable
	 */
	private function guardRoutesAreTraversable( $routes )
	{
{'fraction_non_alphanumeric': 0.12835387962291517, 'fraction_numerical': 0.0, 'mean_word_length': 4.454545454545454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5158616', 'n_tokens_mistral': 499, 'n_tokens_neox': 493, 'n_words': 81}