<commit_before><?php
/**
 * Go! AOP framework
 *
 * @copyright Copyright 2012, <NAME> <<EMAIL>>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Go\Aop\Support;

use Go\Aop\PointFilter;
use TokenReflection\ReflectionFileNamespace as ParsedReflectionFileNamespace;

/**
 * Simple namespace matcher that match only specific namespace name
 *
 * Namespace name can contain wildcards '*', '**' and '?'
 */
class SimpleNamespaceFilter implements PointFilter
{

    /**
     * Namespace name to match, can contain wildcards *,?
     *
     * @var string
     */
    protected $nsName = '';

    /**
     * Namespace name matcher constructor
     *
     * @param string $namespaceName Name of the namespace to match or glob pattern
     */
    public function __construct($namespaceName)
    {
        $namespaceName = trim($namespaceName, '\\');
        $this->nsName  = $namespaceName;
        $this->regexp  = strtr(preg_quote($this->nsName, '/'), array(
            '\\*'    => '[^\\\\]+',
            '\\*\\*' => '.+',
            '\\?'    => '.',
            '\\|'    => '|'
        ));
    }

    /**
     * {@inheritdoc}
     * @param ParsedReflectionFileNamespace|string $ns
     */
    public function matches($ns)
    {
        $isNamespaceIsObject = ($ns === (object) $ns);

        if ($isNamespaceIsObject && !$ns instanceof ParsedReflectionFileNamespace) {
            return false;
        }

        $nsName = $isNamespaceIsObject ? $ns->getName() : $ns;

        return ($nsName === $this->nsName) || (bool) preg_match("/^(?:{$this->regexp})$/", $nsName);
    }

    /**
     * Returns the kind of point filter
     *
     * @return integer
     */
    public function getKind()
    {
        return 0; //self::KIND_CLASS;
    }
}<commit_msg>[Insight] Commented code should not be commited, fixed #200<commit_after><?php
/**
 * Go! AOP framework
 *
 * @copyright Copyright 2012, <NAME> <<EMAIL>>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Go\Aop\Support;

use Go\Aop\PointFilter;
use TokenReflection\ReflectionFileNamespace as ParsedReflectionFileNamespace;

/**
 * Simple namespace matcher that match only specific namespace name
 *
 * Namespace name can contain wildcards '*', '**' and '?'
 */
class SimpleNamespaceFilter implements PointFilter
{

    /**
     * Namespace name to match, can contain wildcards *,?
     *
     * @var string
     */
    protected $nsName = '';

    /**
     * Namespace name matcher constructor
     *
     * @param string $namespaceName Name of the namespace to match or glob pattern
     */
    public function __construct($namespaceName)
    {
        $namespaceName = trim($namespaceName, '\\');
        $this->nsName  = $namespaceName;
        $this->regexp  = strtr(preg_quote($this->nsName, '/'), array(
            '\\*'    => '[^\\\\]+',
            '\\*\\*' => '.+',
            '\\?'    => '.',
            '\\|'    => '|'
        ));
    }

    /**
     * {@inheritdoc}
     * @param ParsedReflectionFileNamespace|string $ns
     */
    public function matches($ns)
    {
        $isNamespaceIsObject = ($ns === (object) $ns);

        if ($isNamespaceIsObject && !$ns instanceof ParsedReflectionFileNamespace) {
            return false;
        }

        $nsName = $isNamespaceIsObject ? $ns->getName() : $ns;

        return ($nsName === $this->nsName) || (bool) preg_match("/^(?:{$this->regexp})$/", $nsName);
    }

    /**
     * Returns the kind of point filter
     *
     * @return integer
     */
    public function getKind()
    {
        return 0;
    }
}
{'fraction_non_alphanumeric': 0.15274009766684754, 'fraction_numerical': 0.00352685838307108, 'mean_word_length': 2.2919642857142857, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, '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': '5702365', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1067, 'n_words': 275}