<commit_before><?php

namespace DF\PHPCoverFish\Validator;

use DF\PHPCoverFish\Common\CoverFishPHPUnitFile;
use DF\PHPCoverFish\Validator\Base\BaseCoverFishValidator;

/**
 * Class ValidatorClassName, validate that the annotated Class exists (Class)
 *
 * @package   DF\PHPCoverFish
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 <NAME> <<EMAIL>>
 * @license   http://www.opensource.org/licenses/MIT
 * @link      http://github.com/dunkelfrosch/phpcoverfish/tree
 * @since     class available since Release 0.9.0
 * @version   0.9.8
 */
class ValidatorClassName extends BaseCoverFishValidator
{
    /**
     * @return array
     */
    private function execute()
    {
        preg_match_all("/(?P<class>(^(([\\\\])|([A-Z]))([A-Za-z0-9_\\\\]+)$))/", $this->coversToken, $this->result, PREG_SET_ORDER);

        return $this->result;
    }

    /**
     * @return bool
     */
    public function validate()
    {
        return count($this->execute()) > 0;
    }

    /**
     * @return bool
     */
    public function validateResultKeys()
    {
        return array_key_exists('class', $this->getResult());
    }

    /**
     * @param CoverFishPHPUnitFile $phpUnitFile
     *
     * @return array
     */
    public function getMapping(CoverFishPHPUnitFile $phpUnitFile)
    {
        $class = $this->getResult()['class'];
        // fqn detected? fully qualified classNames will be used directly without any kind of counterCheck
        // against use statement(s) - otherwise classFQN will be taken from use statement directly.
        if (true === $this->checkClassHasFQN($class)) {
            $classFQN = $class;
            $class = $this->coverFishHelper->getClassNameFromClassFQN($classFQN);
        } else {
            $classFQN = $this->coverFishHelper->getClassFromUse($class, $phpUnitFile->getUsedClasses());
        }

        $mappingOptions = array(
            'coverToken' => $this->coversToken,
            'coverMethod' => null,
            'coverAccessor' => null,<commit_msg>fix corresponding validator after extend coverFishHelper class<commit_after><?php

namespace DF\PHPCoverFish\Validator;

use DF\PHPCoverFish\Common\CoverFishPHPUnitFile;
use DF\PHPCoverFish\Validator\Base\BaseCoverFishValidator;

/**
 * Class ValidatorClassName, validate that the annotated Class exists (Class)
 *
 * @package   DF\PHPCoverFish
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015 <NAME> <<EMAIL>>
 * @license   http://www.opensource.org/licenses/MIT
 * @link      http://github.com/dunkelfrosch/phpcoverfish/tree
 * @since     class available since Release 0.9.0
 * @version   0.9.9
 */
class ValidatorClassName extends BaseCoverFishValidator
{
    /**
     * @return array
     */
    private function execute()
    {
        preg_match_all("/(?P<class>(^(([\\\\])|([A-Z]))([A-Za-z0-9_\\\\]+)$))/", $this->coversToken, $this->result, PREG_SET_ORDER);

        return $this->result;
    }

    /**
     * @return bool
     */
    public function validate()
    {
        return count($this->execute()) > 0;
    }

    /**
     * @return bool
     */
    public function validateResultKeys()
    {
        return array_key_exists('class', $this->getResult());
    }

    /**
     * @param CoverFishPHPUnitFile $phpUnitFile
     *
     * @return array
     */
    public function getMapping(CoverFishPHPUnitFile $phpUnitFile)
    {
        $class = $this->getResult()['class'];
        // fqn detected? fully qualified classNames will be used directly without any kind of counterCheck
        // against use statement(s) - otherwise classFQN will be taken from use statement directly.
        $classFQN = $this->coverFishHelper->getClassFromUse($class, $phpUnitFile->getUsedClasses());
        if (true === $this->coverFishHelper->checkClassHasFQN($class)) {
            $classFQN = $class;
            $class = $this->coverFishHelper->getClassNameFromClassFQN($classFQN);
        }

        $mappingOptions = array(
            'coverToken' => $this->coversToken,
            'coverMethod' => null,
            'coverAccessor' => null,
{'fraction_non_alphanumeric': 0.14162348877374784, 'fraction_numerical': 0.006415001233654083, 'mean_word_length': 2.722681359044995, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4548684', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1216, 'n_words': 252}