Skip to content

Commit

Permalink
Formatted method argument spacing
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <tom@inflatablecookie.com>
  • Loading branch information
betterthanclay committed Nov 3, 2023
1 parent 0924ef2 commit 38e248e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ public function normalizeTimezoneString(
/**
* Parse and create DateTimeZone
*/
protected function createTimezone(string $timezone): Timezone
{
protected function createTimezone(
string $timezone
): Timezone {
if (preg_match('/^[a-z]{3}$/', $timezone)) {
$timezone = strtoupper($timezone);
} elseif (preg_match('|^([a-z\-]+)/([a-z\-]+)$|', $timezone, $matches)) {
Expand Down
35 changes: 21 additions & 14 deletions src/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class Locale implements Dumpable
*
* @param array<string, string> $subtags
*/
public static function compose(array $subtags): static
{
public static function compose(
array $subtags
): static {
/** @phpstan-ignore-next-line */
if (false === ($locale = SysLocale::composeLocale($subtags))) {
throw Exceptional::InvalidArguemnt(
Expand All @@ -40,17 +41,19 @@ public static function compose(array $subtags): static
/**
* Init with string representation
*/
final public function __construct(string $locale)
{
final public function __construct(
string $locale
) {
$this->canonical = SysLocale::canonicalize($locale);
}


/**
* Get current display name
*/
public function getName(?string $inLocale = null): string
{
public function getName(
?string $inLocale = null
): string {
return SysLocale::getDisplayName($this->canonical, $inLocale);
}

Expand All @@ -66,8 +69,9 @@ public function getLanguage(): string
/**
* Get current language display name
*/
public function getLanguageName(?string $inLocale = null): string
{
public function getLanguageName(
?string $inLocale = null
): string {
return SysLocale::getDisplayLanguage($this->canonical, $inLocale);
}

Expand All @@ -89,8 +93,9 @@ public function getRegion(): ?string
/**
* Get current region display name
*/
public function getRegionName(?string $inLocale = null): ?string
{
public function getRegionName(
?string $inLocale = null
): ?string {
$output = SysLocale::getDisplayRegion($this->canonical, $inLocale);

if (!strlen($output)) {
Expand Down Expand Up @@ -118,8 +123,9 @@ public function getScript(): ?string
/**
* Get current script display name
*/
public function getScriptName(?string $inLocale = null): ?string
{
public function getScriptName(
?string $inLocale = null
): ?string {
$output = SysLocale::getDisplayScript($this->canonical, $inLocale);

if (!strlen($output)) {
Expand Down Expand Up @@ -149,8 +155,9 @@ public function getVariants(): array
/**
* Get current script variant name
*/
public function getVariantName(?string $inLocale = null): ?string
{
public function getVariantName(
?string $inLocale = null
): ?string {
$output = SysLocale::getDisplayVariant($this->canonical, $inLocale);

if (!strlen((string)$output)) {
Expand Down

0 comments on commit 38e248e

Please sign in to comment.