LocaleBundle
LocaleBundle copied to clipboard
[Insight] Logical operators should be avoided - in LocaleGuesser/BrowserLocaleGuesser.php, line 52
in LocaleGuesser/BrowserLocaleGuesser.php, line 52
The
oroperator does not have the same precedence as||. This could lead to unexpected behavior, use||instead.
$validator = $this->metaValidator;
// Get the preferred locale from the Browser.
$preferredLocale = $request->getPreferredLanguage();
$availableLocales = $request->getLanguages();
if (!$preferredLocale OR count($availableLocales) === 0) {
return false;
}
// If the preferred primary locale is allowed, return the locale.
if ($validator->isAllowed($preferredLocale)) {
Posted from SensioLabsInsight