<commit_before><?php

namespace Rudolf\Alerts;

class AlertsCollection {

	/**
	 * @var array
	 */
	private static $collection;

	/**
	 * Add alert to collection
	 * 
	 * @param Alert $alert Alert object
	 * 
	 * @return void
	 */
	public static function add(\Rudolf\Alerts\Alert $alert) {
		self::$collection[] = $alert;
	}

	/**
	 * Get alerts by type
	 * 
	 * @param string $type Alert type
	 * 
	 * @return Alert array
	 */
	public static function getByType($type) {
		$collection = self::$collection;

		foreach (self::$collection as $key => $value) {
			if($type === $value->getType()) {
				$newCollection[] = $value;
			}
		}

		return $newCollection;
	}

	/**
	 * Get all alerts
	 * 
	 * @return Alert array
	 */
	public static function getAll() {
		return self::$collection;
	}
}
<commit_msg>Add isAlerts() method<commit_after><?php

namespace Rudolf\Alerts;

class AlertsCollection {

	/**
	 * @var array
	 */
	private static $collection;

	/**
	 * Add alert to collection
	 * 
	 * @param Alert $alert Alert object
	 * 
	 * @return void
	 */
	public static function add(\Rudolf\Alerts\Alert $alert) {
		self::$collection[] = $alert;
	}

	/**
	 * Get alerts by type
	 * 
	 * @param string $type Alert type
	 * 
	 * @return Alert array
	 */
	public static function getByType($type) {
		$collection = self::$collection;

		foreach (self::$collection as $key => $value) {
			if($type === $value->getType()) {
				$newCollection[] = $value;
			}
		}

		return $newCollection;
	}

	/**
	 * Checks whether were any alert
	 * 
	 * @return bool
	 */
	public static function isAlerts() {
		return (bool) !empty(self::$collection);
	}

	/**
	 * Get all alerts
	 * 
	 * @return Alert array
	 */
	public static function getAll() {
		return self::$collection;
	}
}

{'fraction_non_alphanumeric': 0.14982973893303064, 'fraction_numerical': 0.0, 'mean_word_length': 2.9440715883668904, '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': '6696876', 'n_tokens_mistral': 651, 'n_tokens_neox': 558, 'n_words': 154}