<commit_before><?php namespace Leean\Endpoints\Inc;

/**
 * Class Template
 *
 * @package Leean\Endpoints\Inc
 */
class Template
{
	/**
	 * Returns the template used on a page:
	 *
	 * - Default for the default page template
	 * - Template Slug
	 * - Empty string if the post is not a page.
	 *
	 * @param Int|\WP_Post $post The post
	 * @return string
	 */
	public static function get( $post ) {
		$post = is_a( $post, 'WP_Post' ) ? $post : get_post( $post );
		$template = '';
		if ( 'page' === $post->post_type ) {
			$template_slug = get_page_template_slug( $post->ID );
			$template = empty( $template_slug )
				? 'default'
				: basename( $template_slug, '.php' );
		}
		return $template;
	}
}
<commit_msg>Update the type of the functio<commit_after><?php namespace Leean\Endpoints\Inc;

/**
 * Class Template
 *
 * @package Leean\Endpoints\Inc
 */
class Template
{
	/**
	 * Returns the type for the post, the term template applies to what type of
	 * post is or what type of template is using.
	 *
	 * @param Int|\WP_Post $post The post
	 * @return string
	 */
	public static function get( $post ) {
		$post = is_a( $post, 'WP_Post' ) ? $post : get_post( $post );
		$type = $post->post_type;
		if ( 'page' === $type ) {
			$template_slug = get_page_template_slug( $post->ID );
			$type = empty( $template_slug )
				? 'default'
				: basename( $template_slug, '.php' );
		}
		return $type;
	}
}

{'fraction_non_alphanumeric': 0.14896650035637918, 'fraction_numerical': 0.0, 'mean_word_length': 3.1052631578947367, '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': '5279565', 'n_tokens_mistral': 529, 'n_tokens_neox': 488, 'n_words': 141}