<commit_before><?php

/**
 * Class ProviderFassadeBehaviorBuilder
 *
 * @author <NAME> <<EMAIL>>
 */
class ProviderFassadeBehaviorBuilder extends OMBuilder
{

    public function build()
    {

        $className = $this->getClassname();
        $nameSpace = $this->getNamespace();
        $phpDir = $this->getBuildProperty('phpDir');
        $fassadePath = $phpDir.DIRECTORY_SEPARATOR.$this->getClassFilePath();
        $outputDir = $this->getBuildProperty('outputDir');

        if (in_array($this->getBuildProperty('behaviorProviderCachefile'), array('true', 'on', 'yes', '1'))) {
            $cacheFile = $outputDir.DIRECTORY_SEPARATOR.'providerCache.json';

//            Check if a special constant has been defined - if not, this is the first run of
//            and Provider build, so we need to clear the cache.
            if(!defined('BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED') || true != BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED) {
                unlink($cacheFile);
                touch($cacheFile);
                define('BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED', true);
            }

            $cache = (array) json_decode(file_get_contents($cacheFile), true);
            if (JSON_ERROR_NONE == json_last_error()) {
                $cache[] = array(
                    'namespace' => $nameSpace,
                    'modelName' => str_replace('Provider', '', $className),
                    'providerNamespace' => $nameSpace.'\\'.$className
                );
                file_put_contents($cacheFile, json_encode($cache));
            }
        }

        if (file_exists($fassadePath)) {
            // Fassade already exists.
            // It is not possible to just stop the process here and continue with the next file,
            // so we return the source string just as it is in the current file, so it does not get overwritten
            $sourceString = file_get_contents($fassadePath);
        } else {
            // Fassade does not exist yet, so we build it
            $sourceString = parent::build();
        }

        return $sourceString;
    }<commit_msg>Includes package into providerCache<commit_after><?php

/**
 * Class ProviderFassadeBehaviorBuilder
 *
 * @author <NAME> <<EMAIL>>
 */
class ProviderFassadeBehaviorBuilder extends OMBuilder
{

    public function build()
    {
        $phpDir = $this->getBuildProperty('phpDir');
        $fassadePath = $phpDir.DIRECTORY_SEPARATOR.$this->getClassFilePath();

        if (in_array($this->getBuildProperty('behaviorProviderCachefile'), array('true', 'on', 'yes', '1'))) {
            $outputDir = $this->getBuildProperty('outputDir');
            $cacheFile = $outputDir.DIRECTORY_SEPARATOR.'providerCache.json';
            $className = $this->getClassname();
            $package = $this->getPackage();
            $nameSpace = $this->getNamespace();

//            Check if a special constant has been defined - if not, this is the first run of
//            and Provider build, so we need to clear the cache.
            if(!defined('BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED') || true != BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED) {
                unlink($cacheFile);
                touch($cacheFile);
                define('BEHAVIOR_PROVIDER_FASSADE_CACHE_CLEARED', true);
            }

            $cache = (array) json_decode(file_get_contents($cacheFile), true);
            if (JSON_ERROR_NONE == json_last_error()) {
                $cache[] = array(
                    'package' => $package,
                    'namespace' => $nameSpace,
                    'modelName' => str_replace('Provider', '', $className),
                    'providerName' => $className
                );
                file_put_contents($cacheFile, json_encode($cache));
            }
        }

        if (file_exists($fassadePath)) {
            // Fassade already exists.
            // It is not possible to just stop the process here and continue with the next file,
            // so we return the source string just as it is in the current file, so it does not get overwritten
            $sourceString = file_get_contents($fassadePath);
        } else {
            // Fassade does not exist yet, so we build it
            $sourceString = parent::build();
        }

        return $sourceString;
    }
{'fraction_non_alphanumeric': 0.1153935453912236, 'fraction_numerical': 0.0004643603436266543, 'mean_word_length': 2.205357142857143, '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': '373473', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1158, 'n_words': 285}