<commit_before><?php declare(strict_types=1);


namespace Shopware\Psh\ScriptRuntime;

/**
 * Replace the placeholders with there values
 */
class TemplateEngine
{
    const REGEX = '/__[A-Z,_]+__(?!\(sic\!\))/';

    const REGEX_SIC = '/__[A-Z,_]+__(\(sic\!\))/';

    /**
     * @param string $shellCommand
     * @param ValueProvider[] $allValues
     * @return string
     */
    public function render(string $shellCommand, array $allValues): string
    {
        preg_match_all(self::REGEX, $shellCommand, $matches);
        $placeholders = $matches[0];

        foreach ($placeholders as $match) {
            $shellCommand = str_replace($match, $this->getValue($match, $allValues), $shellCommand);
        }

        preg_match_all(self::REGEX_SIC, $shellCommand, $matches);
        $escapedPlaceholders = $matches[0];

        foreach ($escapedPlaceholders as $match) {
            $shellCommand = str_replace($match, str_replace('(sic!)', '', $match), $shellCommand);
        }<commit_msg>Implement Constant concatenating<commit_after><?php declare(strict_types=1);


namespace Shopware\Psh\ScriptRuntime;

/**
 * Replace the placeholders with there values
 */
class TemplateEngine
{
    const REGEX = '/__[A-Z,_]+?__(?!\(sic\!\))/';

    const REGEX_SIC = '/__[A-Z,_]+?__(\(sic\!\))/';

    /**
     * @param string $shellCommand
     * @param ValueProvider[] $allValues
     * @return string
     */
    public function render(string $shellCommand, array $allValues): string
    {
        preg_match_all(self::REGEX, $shellCommand, $matches);
        $placeholders = $matches[0];

        foreach ($placeholders as $match) {
            $shellCommand = str_replace($match, $this->getValue($match, $allValues), $shellCommand);
        }

        preg_match_all(self::REGEX_SIC, $shellCommand, $matches);
        $escapedPlaceholders = $matches[0];

        foreach ($escapedPlaceholders as $match) {
            $shellCommand = str_replace($match, str_replace('(sic!)', '', $match), $shellCommand);
        }
{'fraction_non_alphanumeric': 0.16047548291233285, 'fraction_numerical': 0.0029717682020802376, 'mean_word_length': 3.2171189979123174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2871337', 'n_tokens_mistral': 637, 'n_tokens_neox': 609, 'n_words': 124}