for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Tleckie\Translate\Resolver;
use function explode;
/**
* Class Locale
*
* @package Tleckie\Translate\Resolver
* @category Locale
* @author Teodoro Leckie Westberg <[email protected]>
*/
class Locale
{
* @var string
protected string $locale;
* @param string $locale
* @return $this
public function setLocale(string $locale): Locale
$this->locale = $locale;
return $this;
}
* @return array
public function toArray(): array
$priority = [$this->locale];
[$language,] = @explode('_', $this->locale);
$priority[] = $language;
return $priority;