<commit_before><?php

return [
    'patchers' => [
        function ($filePath, $prefix, $contents) {
            //
            // PHP-Parser patch
            //
            if ($filePath === 'vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php') {
                $length = 15 + strlen($prefix) + 1;

                return preg_replace(
                    '%strpos\((.+?)\) \+ 15%',
                    sprintf('strpos($1) + %d', $length),
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            return str_replace(
                '\\'.$prefix.'\Composer\Autoload\ClassLoader',
                '\Composer\Autoload\ClassLoader',
                $contents
            );
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'src/Psalm') === 0) {
                return str_replace(
                    [' \\Psalm\\Internal\\', ' \\PhpParser\\'],
                    [' \\' . $prefix . '\\Psalm\\Internal\\', ' \\' . $prefix . '\\PhpParser\\'],
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'vendor/phpmyadmin/sql-parser/src/Context.php') === 0) {
                return str_replace(
                    '\'' . $prefix,
                    '\'\\\\' . $prefix,
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'vendor/openlss') === 0) {
                return str_replace(
                    $prefix . '\\DomDocument',
                    'DomDocument',
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if ($filePath === 'src/psalm.php') {
                return str_replace(
                    '\\' . $prefix . '\\PSALM_VERSION',
                    'PSALM_VERSION',
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            $ret = preg_replace(
                '/' . $prefix . '\\\\Psalm\\\\(?=!Internal)/',
                'Psalm\\',
                $contents
            );
            return $ret;
        },
    ],
    'whitelist' => [
        \Composer\Autoload\ClassLoader::class,
        'Psalm\\*',
    ],
    'files-whitelist' => [
        'src/Psalm/Internal/PropertyMap.php',
        'src/Psalm/Internal/CallMap.php',
        'src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub',
        'src/Psalm/Internal/Stubs/CoreGenericClasses.phpstub',
        'src/spl_object_id.php',
    ],
];<commit_msg>Don’t scope any Psalm namespaces<commit_after><?php

return [
    'patchers' => [
        function ($filePath, $prefix, $contents) {
            //
            // PHP-Parser patch
            //
            if ($filePath === 'vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php') {
                $length = 15 + strlen($prefix) + 1;

                return preg_replace(
                    '%strpos\((.+?)\) \+ 15%',
                    sprintf('strpos($1) + %d', $length),
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            return str_replace(
                '\\'.$prefix.'\Composer\Autoload\ClassLoader',
                '\Composer\Autoload\ClassLoader',
                $contents
            );
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'src/Psalm') === 0) {
                return str_replace(
                    [' \\Psalm\\Internal\\', ' \\PhpParser\\'],
                    [' \\' . $prefix . '\\Psalm\\Internal\\', ' \\' . $prefix . '\\PhpParser\\'],
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'vendor/phpmyadmin/sql-parser/src/Context.php') === 0) {
                return str_replace(
                    '\'' . $prefix,
                    '\'\\\\' . $prefix,
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if (strpos($filePath, 'vendor/openlss') === 0) {
                return str_replace(
                    $prefix . '\\DomDocument',
                    'DomDocument',
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            if ($filePath === 'src/psalm.php') {
                return str_replace(
                    '\\' . $prefix . '\\PSALM_VERSION',
                    'PSALM_VERSION',
                    $contents
                );
            }

            return $contents;
        },
        function ($filePath, $prefix, $contents) {
            $ret = str_replace(
                $prefix . '\\Psalm\\',
                'Psalm\\',
                $contents
            );
            return $ret;
        },
    ],
    'whitelist' => [
        \Composer\Autoload\ClassLoader::class,
        'Psalm\*',
    ],
    'files-whitelist' => [
        'src/Psalm/Internal/PropertyMap.php',
        'src/Psalm/Internal/CallMap.php',
        'src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub',
        'src/Psalm/Internal/Stubs/CoreGenericClasses.phpstub',
        'src/spl_object_id.php',
    ],
];
{'fraction_non_alphanumeric': 0.1528331311731069, 'fraction_numerical': 0.0031190434933287127, 'mean_word_length': 1.1150604617075852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2704257', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1549, 'n_words': 246}