Create arguments for external speller.

@param EncodingAwareSource $source    Text source to check.
@param array               $languages List of languages used in text (IETF language tag).

@return string[]

@since 1.6
350086
protected function createArguments(EncodingAwareSource $source, array $languages): array
    {
        $args = [
            // Input encoding
            '--encoding=' . ($source instanceof EncodingAwareSource ? $source->getEncoding(
            ) : 'UTF-8'),
            '-a' // ispell compatible output
        ];

        if (count($languages) > 0) {
            $args[] = '--lang=' . $languages[0];
        }

        if ($this->personalDictionary !== null) {
            $args[] = '--personal=' . $this->personalDictionary->getPath();
        }

        return $args;
    }
89493
protected function lowercase( array $source )
    {
    	$result = array();

    	foreach ($source as $key => $value )
    		$result[strtolower($key)] = $value;

    	return $result;
    }
382968
private function parse($source)
    {
        $parser = $this->getParser();
        $parser->setPragmas($this->getPragmas());

        return $parser->parse($this->tokenize($source));
    }
1061609
protected function getWordsRegexp(array $words)
	{
		$expr  = RegexpBuilder::fromList($words, $this->regexpOptions);
		$regexp = new Regexp('/(?<![\\pL\\pN])' . $expr . '(?![\\pL\\pN])/Siu');

		// JavaScript regexps don't support Unicode properties, so instead of Unicode letters
		// we'll accept any non-whitespace, non-common punctuation
		$expr = str_replace('[\\pL\\pN]', '[^\\s!-\\/:-?]', $expr);
		$expr = str_replace('(?>',        '(?:',            $expr);
		$regexp->setJS('/(?:^|\\W)' . $expr . '(?!\\w)/gi');

		return $regexp;
	}
822282
private function sourceOptions(Source $source): array
    {
        $name = strip_tags($source->fullName());

        return [
            'only'   => strip_tags($source->fullName()),
            'linked' => I18N::translate('%s and the individuals that reference it.', $name),
        ];
    }
622816
public function generateElements($language = null)
    {
        $sitemapElements = [];
        $transformer = $this->transformer;

        $entities = $this
            ->entitySitemapElementProvider
            ->getEntities();

        if (is_array($entities)) {
            foreach ($entities as $entity) {
                $sitemapElements[] = $this
                    ->sitemapElementFactory
                    ->create(
                        $transformer->getLoc($entity, $language),
                        $transformer->getLastMod($entity, $language),
                        $this->changeFrequency,
                        $this->priority
                    );
            }
        }

        return $sitemapElements;
    }
1268954
public static final function left(array $Source, $to): array {
		return array_slice($Source, 0, self::find(array_keys($Source),
			$to, count($Source) - 1) + 1);
	}
1100458
private function getLanguagesNumbers(array $languages): array
    {
        $languagesNumbers = array_column($languages, 'id');

        return array_combine($languagesNumbers, array_fill_keys($languagesNumbers, false));
    }
1158998
public function getPlaceholders($language)
    {
        return [
            [
                'placeholder' => '%s',
                'title' => $this->translator->trans('siteroots.siteroot_title', [], 'gui', $language),
            ],
            [
                'placeholder' => '%b',
                'title' => $this->translator->trans('siteroots.element_backend_title', [], 'gui', $language),
            ],
            [
                'placeholder' => '%p',
                'title' => $this->translator->trans('siteroots.element_page_title', [], 'gui', $language),
            ],
            [
                'placeholder' => '%n',
                'title' => $this->translator->trans('siteroots.element_navigation_title', [], 'gui', $language),
            ],
            [
                'placeholder' => '%r',
                'title' => $this->translator->trans('siteroots.project_title', [], 'gui', $language),
            ],
        ];
    }
1148561
protected function getListMap($source)
    {
        // Extract Map from ID / Text Fields:
        
        if ($source instanceof SS_List) {
            $source = $source->map($this->getIDField(), $this->getTextField());
        }
        
        // Convert Map to Array:
        
        if ($source instanceof Map) {
            $source = $source->toArray();
        }
        
        // Determine Invalid Types:
        
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }
        
        // Answer Data Source:
        
        return $source;
    }
594228
private function findSourceMessage($message)
    {
        $sourceMessages = LanguageSource::findAll(['message' => $message, 'category' => $this->category]);

        foreach ($sourceMessages as $source) {
            if ($source->message === $message) {
                return $source;
            }
        }
    }
1177994
protected function storeCache(array $languages, string $listIndex = null): void
    {
        $this->cache->setMulti(
            $languages,
            static function (Language $language) {
                return [
                        'ez-language-' . $language->id,
                        'ez-language-code-' . $language->languageCode,
                    ];
            },
            $listIndex
        );
    }
685529
public function loadTranslations($languages)
    {
        $languages = (array)$languages;

        foreach ($languages as $language) {
            $this->getTranslation($language);
        }
    }
151712
public final static function clear(string $source, $keys): string {
		return self::encode(Arr::clear(self::decode($source),
			...array_slice(func_get_args(), 1)));
	}
972026
private function loadWithSource($Source)
    {
        if (empty ($Source)) {
            return array();
        }
        if ($this->settingUseSyckIsPossible && function_exists ('syck_load')) {
            $array = syck_load (implode ('', $Source));

            return is_array($array) ? $array : array();
        }

        $this->path = array();
        $this->result = array();
        $cnt = count($Source);

        for ($i = 0; $i < $cnt; $i++) {
            $line = $Source[$i];

            $this->indent = strlen($line) - strlen(ltrim($line));
            $tempPath = $this->getParentPathByIndent($this->indent);
            $line = self::stripIndent($line, $this->indent);

            if (self::isComment($line)) {
                continue;
            }
            if (self::isEmpty($line)) {
                continue;
            }

            $this->path = $tempPath;
            $literalBlockStyle = self::startsLiteralBlock($line);

            if ($literalBlockStyle) {
                $line = rtrim ($line, $literalBlockStyle . " \n");
                $literalBlock = '';
                $line .= $this->LiteralPlaceHolder;
                $literal_block_indent = strlen($Source[$i+1]) - strlen(ltrim($Source[$i+1]));

                while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) {
                    $literalBlock = $this->addLiteralLine(
                        $literalBlock, $Source[$i], $literalBlockStyle, $literal_block_indent
                    );
                }

                $i--;
            }

            while (++$i < $cnt && self::greedilyNeedNextLine($line)) {
                $line = rtrim($line, " \n\t\r") . ' ' . ltrim($Source[$i], " \t");
            }

            $i--;

            if (strpos($line, '#')) {
                if (strpos($line, '"') === false && strpos($line, "'") === false) {
                    $line = preg_replace('/\s+#(.+)$/','',$line);
                }
            }

            $lineArray = $this->parseLine($line);

            if ($literalBlockStyle) {
                $lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock);
            }

            $this->addArray($lineArray, $this->indent);

            foreach ($this->delayedPath as $indent => $delayedPath) {
                $this->path[$indent] = $delayedPath;
            }

            $this->delayedPath = array();

        }

        return $this->result;
    }
67676
public function addTranslationArray(array $translations, $language)
    {
        $language = (string) $language;
        if ($language === '') {
            throw new \InvalidArgumentException('$language cannot be empty');
        }

        if (!isset($this->translations[$language])) {
            $this->translations[$language] = [];
        }

        $this->translations[$language] = array_merge(
            $this->translations[$language],
            $translations
        );
    }
220229
protected function addPKCS7Padding($source){
        $source = trim($source);
        $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);

        $pad = $block - (strlen($source) % $block);
        if ($pad <= $block) {
            $char = chr($pad);
            $source .= str_repeat($char, $pad);
        }
        return $source;
    }