CodeExplorer assertValidLocale example
public function addResource(string
$format, mixed
$resource, string
$locale, string
$domain = null
) { $domain ??= 'messages';
$this->
assertValidLocale($locale);
$locale ?:
$locale =
class_exists(\Locale::
class) ? \Locale::
getDefault() : 'en';
$this->resources
[$locale][] =
[$format,
$resource,
$domain];
if (\
in_array($locale,
$this->fallbackLocales
)) { $this->catalogues =
[];
} else { unset($this->catalogues
[$locale]);
} }