<commit_before><?php

namespace Papper;

/**
 * Main entry point for Papper, for both creating maps and performing maps.
 * Static proxy to Engine.
 *
 * @author <NAME> <<EMAIL>>
 */
class Papper
{
	/**
	 * Creates a TypeMap for the source's type and destinationType.
	 *
	 * @param string $sourceType
	 * @param string $destinationType
	 * @return MappingExpressionInterface
	 */
	public static function createMap($sourceType, $destinationType)
	{
		return self::engine()->createTypeMap($sourceType, $destinationType);
	}

	/**
	 * Maps source to an instance of destinationType. Mapping is performed according
	 * to the corresponding TypeMap. If no TypeMap exists for source.getClass()
	 * destinationType then one is created.
	 *
	 * @param object|object[] $source
	 * @param string $destinationType
	 * @param string|null $sourceType
	 * @return object
	 */
	public static function map($source, $destinationType, $sourceType = null)
	{
		return self::engine()->map($source, $destinationType, $sourceType);
	}

	/**
	 * Returns mapping options
	 *
	 * @return MappingOptionsInterface
	 */
	public function mappingOptions()
	{
		return self::engine()->getConfig()->getMappingOptions();
	}

	/**
	 * Validates that every top level destination property is mapped to source property.
	 * If not, a ConfigurationException is thrown detailing any missing mappings.
	 *
	 * @throws ValidationException if any TypeMaps contain unmapped properties
	 */
	public static function validate()
	{
		self::engine()->validate();
	}

	//<editor-fold desc="Singleton of Engine">
	/**
	 * Returns engine singleton instance
	 *
	 * @return Engine<commit_msg>Fix typo<commit_after><?php

namespace Papper;

/**
 * Main entry point for Papper, for both creating maps and performing maps.
 * Static proxy to Engine.
 *
 * @author <NAME> <<EMAIL>>
 */
class Papper
{
	/**
	 * Creates a TypeMap for the source's type and destinationType.
	 *
	 * @param string $sourceType
	 * @param string $destinationType
	 * @return MappingExpressionInterface
	 */
	public static function createMap($sourceType, $destinationType)
	{
		return self::engine()->createTypeMap($sourceType, $destinationType);
	}

	/**
	 * Maps source to an instance of destinationType. Mapping is performed according
	 * to the corresponding TypeMap. If no TypeMap exists for source.getClass()
	 * destinationType then one is created.
	 *
	 * @param object|object[] $source
	 * @param string $destinationType
	 * @param string|null $sourceType
	 * @return object
	 */
	public static function map($source, $destinationType, $sourceType = null)
	{
		return self::engine()->map($source, $destinationType, $sourceType);
	}

	/**
	 * Returns mapping options
	 *
	 * @return MappingOptionsInterface
	 */
	public function mappingOptions()
	{
		return self::engine()->getConfig()->getMappingOptions();
	}

	/**
	 * Validates that every top level destination property is mapped to source property.
	 * If not, a ValidationException is thrown detailing any missing mappings.
	 *
	 * @throws ValidationException if any TypeMaps contain unmapped properties
	 */
	public static function validate()
	{
		self::engine()->validate();
	}

	//<editor-fold desc="Singleton of Engine">
	/**
	 * Returns engine singleton instance
	 *
	 * @return Engine
{'fraction_non_alphanumeric': 0.11185819070904646, 'fraction_numerical': 0.0, 'mean_word_length': 4.130094043887147, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, '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': '5286383', 'n_tokens_mistral': 940, 'n_tokens_neox': 860, 'n_words': 304}