<commit_before><?php

namespace Denpa\Bitcoin\Exceptions;

use Exception;

abstract class ClientException extends Exception
{
    /**
     * Returns class name in provided namespace.
     *
     * @param string $namespace
     *
     * @return \Exception
     */
    protected function withNamespace($namespace)
    {
        $classname = basename(static::class);

        $class = $namespace."\\$classname";

        if (!class_exists($class)) {
            class_alias(static::class, $class);
        }

        return new $class(...$this->getConstructorParameters());
    }
<commit_msg>Added method to get class basename.<commit_after><?php

namespace Denpa\Bitcoin\Exceptions;

use Exception;

abstract class ClientException extends Exception
{
    /**
     * Returns class name in provided namespace.
     *
     * @param string $namespace
     *
     * @return \Exception
     */
    protected function withNamespace($namespace)
    {
        $classname = $this->getBasename();

        $class = $namespace."\\$classname";

        if (!class_exists($class)) {
            class_alias(static::class, $class);
        }

        return new $class(...$this->getConstructorParameters());
    }

    /**
     * Gets exception basename.
     *
     * @return string
     */
    protected function getBasename()
    {
        $pos = ($pos = strrpos(static::class, '\\')) !== false ? $pos + 1 : 0;
        return substr(static::class, $pos);
    }

{'fraction_non_alphanumeric': 0.13407049067035245, 'fraction_numerical': 0.00138217000691085, 'mean_word_length': 2.3674418604651164, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '5917865', 'n_tokens_mistral': 408, 'n_tokens_neox': 400, 'n_words': 93}