@param string $code

@return string
427641
private function prefixWithSpaces($code)
    {
        $lines = explode("\n", $code);

        foreach ($lines as $key => $value) {
            if ($value) {
                $lines[$key] = $this->spaces . $lines[$key];
            }
        }

        return implode("\n", $lines);
    }
308196
private function codeToMessage($code)
    {
        switch ($code) {
            case JSON_ERROR_SYNTAX:
                $message = "Syntax error";
                break;
            // @codeCoverageIgnoreStart
            // Hard to test cases of JSON error
            case JSON_ERROR_DEPTH:
                $message = "The maximum stack depth has been exceeded";
                break;
            case JSON_ERROR_STATE_MISMATCH:
                $message = "Invalid or malformed JSON";
                break;
            case JSON_ERROR_CTRL_CHAR:
                $message = "Control character error, possibly incorrectly encoded";
                break;
            case JSON_ERROR_UTF8:
                $message = "Malformed UTF-8 characters, possibly incorrectly encoded";
                break;
            case JSON_ERROR_RECURSION:
                $message = "One or more recursive references in the value to be encoded";
                break;
            case JSON_ERROR_INF_OR_NAN:
                $message = "One or more NAN or INF values in the value to be encoded";
                break;
            case JSON_ERROR_UNSUPPORTED_TYPE:
                $message = "A value of a type that cannot be encoded was given";
                break;
            case JSON_ERROR_INVALID_PROPERTY_NAME:
                $message = "A property name that cannot be encoded was given";
                break;
            case JSON_ERROR_UTF16:
                $message = "Malformed UTF-16 characters, possibly incorrectly encoded";
                break;
            default:
                $message = "Unknown localization error";
                break;
            // @codeCoverageIgnoreEnd
        }
        return $message;
    }
1080823
public function repositories(string $code=''){
    $all = $this->options->full_soptions($this->options->from_code('PATHS', 'ide', 'appui'));      
    $cats = [];
    $r = [];
    foreach ( $all as $a ){
      if ( \defined($a['bbn_path']) ){
        $k = $a['bbn_path'] . '/' . ($a['code'] === '/' ? '' : $a['code']);
        if ( !isset($cats[$a['id_alias']]) ){
          unset($a['alias']['cfg']);
          $cats[$a['id_alias']] = $a['alias'];
        }
        unset($a['cfg']);
        unset($a['alias']);
        $r[$k] = $a;
        $r[$k]['title'] = $r[$k]['text'];
        $r[$k]['alias_code'] = $cats[$a['id_alias']]['code'];
        if ( !empty($cats[$a['id_alias']]['tabs']) ){
          $r[$k]['tabs'] = $cats[$a['id_alias']]['tabs'];
        }
        else if( !empty($cats[$a['id_alias']]['extensions']) ){
          $r[$k]['extensions'] = $cats[$a['id_alias']]['extensions'];
        }
        unset($r[$k]['alias']);
      }
    }
    if ( $code ){
      return isset($r[$code]) ? $r[$code] : false;
    }
    return $r;
  }
236421
protected function makeCodeSpan($code) {
		if ($this->code_span_content_func) {
			$code = call_user_func($this->code_span_content_func, $code);
		} else {
			$code = htmlspecialchars(trim($code), ENT_NOQUOTES);
		}
		return $this->hashPart("<code>$code</code>");
	}
823096
public static function getMessageFor($code)
    {
        if (isset(self::$errorMessages[$code])) {
            $message = self::$errorMessages[$code];
        } else {
            $message = 'Unknown error code: "' . $code . '"';
        }

        return $message;
    }
397100
public function fullByCode(string $code)
    {
        $all = $this->full($code);

        return $this->checkAndReturnResult($all);
    }
164280
public static function getName(CountryCode $code)
    {
        $codeValue = $code->toNative();
        $name      = self::$names[$codeValue];

        return new StringLiteral($name);
    }
23294
protected function _codePointToChar($code)
    {
        if ($code <= 0x7F) {
            return chr($code);
        } elseif ($code <= 0x7FF) {
            return chr(($code >> 6) + 192) . chr(($code & 63) + 128);
        } elseif ($code <= 0xFFFF) {
            return chr(($code >> 12) + 224) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128);
        }
        return chr(($code >> 18) + 240) . chr((($code >> 12) & 63) + 128) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128);
    }
664236
public function findByCode($code)
    {
        foreach ($this->sections as $section) {
            if ($section->getCharCodeFrom() <= $code && $section->getCharCodeTo() >= $code) {
                return $section;
            }
        }

        return null;
    }
1298053
protected function forceNamespace($code)
    {
        if (0 === preg_match('/\nnamespace/', $code)) {

            $use = array_filter(explode(PHP_EOL, $code), function($string) {
                return substr($string, 0, 5) === 'use \\';
            });

            $code = str_replace($use, '', $code);
            return "\nnamespace\n{\n" . $code . "\n}\n";
        }

        return $code;
    }
1164953
public static function unserial($code)
    {
        $codeArr = array();

        $codeLines = explode("\n", gzuncompress($code));
        foreach ($codeLines as $line)
            $codeArr[] = str_split($line);

        return $codeArr;
    }
115687
public function getByCode($code)
    {
        if (\is_scalar($code) && ! empty($code = trim($this->uppercaseAndSafeTransliterate($code)))) {
            foreach ($this->items as $auto_category) {
                if ($auto_category->getCode() === $code) {
                    return $auto_category;
                }
            }
        }
    }
1111221
public function getMessage(int $code): string
    {
        return $this->statusExists($code) ? $this->statuses[$code] : self::UNDEFINED_STATUS_MESSAGE;
    }
1351575
public function getName(string $code): string
    {
        $result = $code;

        if (empty($code)) {
            throw new InvalidArgumentException("Code must be a non-empty string.");
        }

        $languages = $this->getSupported();
        if (!empty($languages[$code])) {
            $result = $languages[$code];
        }

        return $result;
    }
913051
public static function getLanguage($code = 'default')
    {
        if ($code == 'default') {
            $code = App::getLocale();
        }

        return self::addNames([$code])[$code];
    }
407284
protected function getCode($code)
    {
        if (is_array($code)) {
            return $this->getCodeArray($code);
        }

        return $this->get($code);
    }
349667
protected function getTokenFields(string $code)
    {
        $data = $this->getTokenBaseFields($code);

        if (is_array($this->tokenFieldsExtra)) {
            $array = $this->tokenFieldsExtra;
            array_walk($array, function ($v, $k) use (&$data) {
                $data = array_add($data, $k, $v);
            });
        }

        return $data;
    }