/** * Must return the first non-empty value */ public function testPrioritize() { $value = Arguments::prioritize([null, "", [], 1, 2, null]); $this->assertEquals($value, 1); }
/** * Returns the current locale * @return String PHP locale string */ public static function getLocale() { $locale = Arguments::prioritize([\Locale::acceptFromHttp(self::safeHeader('HTTP_ACCEPT_LANGUAGE')), \Locale::getDefault(), Config::get('default_locale')]); return $locale; }