<commit_before><?php
/**
 * Joomla! entity library.
 *
 * @copyright  Copyright (C) 2017-2019 <NAME>, Inc. All rights reserved.
 * @license    See COPYING.txt
 */

namespace Phproberto\Joomla\Entity\Helper;

defined('_JEXEC') || die;

use Phproberto\Joomla\Entity\Contracts\EntityInterface;
use Phproberto\Joomla\Entity\Contracts\ExceptionInterface;

/**
 * Helper to deal with class name/namespaces things.
 *
 * @since  __DEPLOY_VERSION__
 */
abstract class ClassName
{
	/**
	 * Check if a class uses namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  boolean
	 */
	public static function inNamespace($class): bool
	{
		return (new \ReflectionClass($class))->inNamespace();
	}

	/**
	 * Retrieve class namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public static function namespace($class): string
	{
		return (new \ReflectionClass($class))->getNamespaceName();
	}

	/**
	 * Guess the entity class
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public static function parentNamespace($class): string
	{
		$namespace = self::namespace($class);

		return substr($namespace, 0, strrpos($namespace, '\\'));
	}

	/**
	 * Retrieve class namespace without namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public function withoutNamespace($class): string
	{
		return (new \ReflectionClass($class))->getShortName();<commit_msg>[fix] withoutNamespace should be static<commit_after><?php
/**
 * Joomla! entity library.
 *
 * @copyright  Copyright (C) 2017-2019 <NAME>, Inc. All rights reserved.
 * @license    See COPYING.txt
 */

namespace Phproberto\Joomla\Entity\Helper;

defined('_JEXEC') || die;

use Phproberto\Joomla\Entity\Contracts\EntityInterface;
use Phproberto\Joomla\Entity\Contracts\ExceptionInterface;

/**
 * Helper to deal with class name/namespaces things.
 *
 * @since  __DEPLOY_VERSION__
 */
abstract class ClassName
{
	/**
	 * Check if a class uses namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  boolean
	 */
	public static function inNamespace($class): bool
	{
		return (new \ReflectionClass($class))->inNamespace();
	}

	/**
	 * Retrieve class namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public static function namespace($class): string
	{
		return (new \ReflectionClass($class))->getNamespaceName();
	}

	/**
	 * Guess the entity class
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public static function parentNamespace($class): string
	{
		$namespace = self::namespace($class);

		return substr($namespace, 0, strrpos($namespace, '\\'));
	}

	/**
	 * Retrieve class namespace without namespace.
	 *
	 * @param   object  $class  Class instance
	 *
	 * @return  string
	 */
	public static function withoutNamespace($class): string
	{
		return (new \ReflectionClass($class))->getShortName();
{'fraction_non_alphanumeric': 0.13157002373685994, 'fraction_numerical': 0.006103763987792472, 'mean_word_length': 3.552469135802469, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '3592597', 'n_tokens_mistral': 973, 'n_tokens_neox': 889, 'n_words': 236}