예제 #1
0
 /**
  * Must return the first non-empty value
  */
 public function testPrioritize()
 {
     $value = Arguments::prioritize([null, "", [], 1, 2, null]);
     $this->assertEquals($value, 1);
 }
예제 #2
0
 /**
  * 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;
 }