Returns the content-transfer-encoding used for this part, defaulting to
'7bit' if not set.

@param string $default pass to override the default when not set.
@return string
339418
public function getContentTransferEncoding($default = '7bit')
    {
        static $translated = [
            'x-uue' => 'x-uuencode',
            'uue' => 'x-uuencode',
            'uuencode' => 'x-uuencode'
        ];
        $type = strtolower($this->getHeaderValue('Content-Transfer-Encoding', $default));
        if (isset($translated[$type])) {
            return $translated[$type];
        }
        return $type;
    }
240483
private function formatDefaultValue($default): string
    {
        if (INF === $default) {
            return 'INF';
        }

        if (\is_string($default)) {
            $default = OutputFormatter::escape($default);
        } elseif (\is_array($default)) {
            foreach ($default as $key => $value) {
                if (\is_string($value)) {
                    $default[$key] = OutputFormatter::escape($value);
                }
            }
        }

        return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
    }
407253
public function getMediumWidth( $default = null ) {

		$prop = $this->properties[ self::PROP_MEDIUM_WIDTH ];

		if( isset( $prop ) && strlen( $prop ) > 0 ) {

			return $prop;
		}

		return $default;
	}
1308419
public static function getExtensionMediaType(string $extension, ?string $defaultMediaType = null):?string
    {
        return self::getMediaTypes()[strtolower($extension)] ?? $defaultMediaType;
    }
1249452
public function get( $key, $default = NULL )
	{
		if( $this->has( $key ) )
			return $this->pairs[( !$this->caseSensitive ? strtolower( $key ) : $key )];
		return $default;
	}
197467
public function getOriginal($key = null, $default = null)
    {
        return array_get($this->toCamelCase($this->original), $key, $default);
    }
979886
public static function getExtension(
        string $type,
        string $default = "unknown"
    ): string
    {
        return array_key_exists($type, self::$types)
            ? self::$types[$type]
            : $default;
    }
1256142
public function getExtraKey($key, $default = null)
    {
        return array_key_exists($key, $this->extra) ? $this->extra[$key] : $default;
    }
346518
public function url($default = null): ?string
    {
        $disk = $this->getAttribute('disk');

        if (Storage::disk($disk)->exists($this->physicalPath())) {
            return Storage::disk($disk)->url($this->physicalPath());
        }

        return $default;
    }
1225106
public function getAcceptableEncodings(?string $default = null): array
	{
		if(!isset($this->acceptableEncodings))
		{
			$this->acceptableEncodings = $this->parseAcceptHeader($this->get('accept-encoding'));
		}

		return $this->acceptableEncodings ?: (array) $default;
	}
515990
public function get($name, $default = null)
    {
        $filename = $this->getCacheFileName($name);
        if (!is_file($filename)) {
            return $default;
        }

        $content      = $this->getContent($name);
        $this->expire = null;

        if ($content !== false) {
            $expire = (int) substr($content, 8, 12);

            if (0 != $expire && time() > filemtime($filename) + $expire) {
                $this->unlink($filename);

                return $default;
            }

            $this->expire = $expire;
            $content      = substr($content, 32);

            // If data compression is enable
            if ($this->options['data_compress'] && function_exists('gzcompress')) {
                $content = gzuncompress($content);
            }

            return $this->unPackData($content);
        } else {
            return $default;
        }
    }
1321118
public static function getLocaleString(string $default = 'en-US'): string
    {
        $i18n = static::get('i18n', null, false);

        return $i18n ? (string)$i18n->getLocale() : $default;
    }
1136222
public function getLanguageUid(int $default = null): int {
    $languageUid = $default ?: 0;

    if (TYPO3_MODE === 'FE') {
      if (isset($GLOBALS['TSFE']->sys_language_uid)) {
        $languageUid = $GLOBALS['TSFE']->sys_language_uid;
      }
    } elseif (is_object($GLOBALS['LANG'])) {
      if (isset($GLOBALS['LANG']->sys_language_uid)) {
        $languageUid = $GLOBALS['LANG']->sys_language_uid;
      }
    }

    return $languageUid;
  }
869542
def content_transfer_encoding(self) \
            -> Optional[ContentTransferEncodingHeader]:
        """"""
        try:
            return cast(ContentTransferEncodingHeader,
                        self[b'content-transfer-encoding'][0])
        except (KeyError, IndexError):
            return None
540625
protected function getPreferredLanguage($default='en-US')
    {
        $acceptedLanguages = $this->getServerCollection()->get('HTTP_ACCEPT_LANGUAGE');

        // regex inspired from @GabrielAnderson on http://stackoverflow.com/questions/6038236/http-accept-language
        preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})*)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $acceptedLanguages, $lang_parse);
        $langs = $lang_parse[1];
        $ranks = $lang_parse[4];

        // (create an associative array 'language' => 'preference')
        $lang2pref = array();
        for($i=0; $i<count($langs); $i++) {
            $lang2pref[$langs[$i]] = (float) (!empty($ranks[$i]) ? $ranks[$i] : 1);
        }

        // (comparison function for uksort)
        $cmpLangs = function ($a, $b) use ($lang2pref) {
            if ($lang2pref[$a] > $lang2pref[$b])
                return -1;
            elseif ($lang2pref[$a] < $lang2pref[$b])
                return 1;
            elseif (strlen($a) > strlen($b))
                return -1;
            elseif (strlen($a) < strlen($b))
                return 1;
            else
                return 0;
        };

        // sort the languages by prefered language and by the most specific region
        uksort($lang2pref, $cmpLangs);

        $tokens = array_keys($lang2pref);
        $current = array_shift($tokens);
        
        if (strlen($current) !== strlen($default)) {
            return ($default !== null) ? $default : $current;
        }
        
        return $current;
    }
1025255
public function getMaxAge($default = false)
    {
        $cacheControl = isset($this->response['header']['Cache-Control'])
            ? $this->response['header']['Cache-Control']
            : null;

        $maxAge = null;
        if ($cacheControl) {
            // max-age=2592000
            $part = explode('=', $cacheControl);
            $maxAge = ($part[0] == "max-age")
                ? (int) $part[1]
                : null;
        }

        if ($maxAge) {
            return $maxAge;
        }

        $expire = isset($this->response['header']['Expires'])
            ? strtotime($this->response['header']['Expires'])
            : null;

        return $expire ? $expire : $default;
    }
103763
public function getOrDefault(string $key, $default)
    {
        if ($this->replacedPayload) {
            if (! \array_key_exists($key, $this->payload)) {
                return $default;
            }

            return $this->payload[$key];
        }

        if ($key === self::MESSAGE) {
            return $this->message;
        }

        return $default;
    }