Admin_SettingsController::checkFallbackLanguageLoop PHP Метод

checkFallbackLanguageLoop() защищенный Метод

protected checkFallbackLanguageLoop ( $source, $definitions, $fallbacks = [] )
    protected function checkFallbackLanguageLoop($source, $definitions, $fallbacks = [])
    {
        if (isset($definitions[$source])) {
            $targets = explode(",", $definitions[$source]);
            foreach ($targets as $l) {
                $target = trim($l);
                if ($target) {
                    if (in_array($target, $fallbacks)) {
                        throw new \Exception("Language `{$source}` | `{$target}` causes an infinte loop.");
                    }
                    $fallbacks[] = $target;
                    $this->checkFallbackLanguageLoop($target, $definitions, $fallbacks);
                }
            }
        } else {
            throw new \Exception("Language `{$source}` doesn't exist");
        }
    }