Skip to content

Commit

Permalink
🎨 Use PER-CS coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Aug 13, 2024
1 parent f431b25 commit 445b079
Show file tree
Hide file tree
Showing 10 changed files with 1,042 additions and 1,047 deletions.
3 changes: 1 addition & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
$config = new PhpCsFixer\Config();
return $config->setRules(
[
'@PSR2' => true,
'@PSR12' => true,
'@PER-CS' => true,
'@PHP81Migration' => true,
'single_quote' => true,
'no_unused_imports' => true,
Expand Down
8 changes: 4 additions & 4 deletions build/BuildMetadataFromXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static function loadTerritoryTagMetadata(
): PhoneMetadata {
$metadata = new PhoneMetadata();
$metadata->setId($regionCode);
$metadata->setCountryCode((int)$element->getAttribute(self::COUNTRY_CODE));
$metadata->setCountryCode((int) $element->getAttribute(self::COUNTRY_CODE));
if ($element->hasAttribute(self::LEADING_DIGITS)) {
$metadata->setLeadingDigits(self::validateRE($element->getAttribute(self::LEADING_DIGITS)));
}
Expand Down Expand Up @@ -450,8 +450,8 @@ private static function parsePossibleLengthStringToSet(string $possibleLengthStr
if (\count($minMax) !== 2) {
throw new \RuntimeException("Ranges must have exactly one - character: missing for {$possibleLengthString}.");
}
$min = (int)$minMax[0];
$max = (int)$minMax[1];
$min = (int) $minMax[0];
$max = (int) $minMax[1];
// We don't even accept [6-7] since we prefer the shorter 6,7 variant; for a range to be in
// use the hyphen needs to replace at least one digit.
if ($max - $min < 2) {
Expand All @@ -471,7 +471,7 @@ private static function parsePossibleLengthStringToSet(string $possibleLengthStr
if (!\is_numeric($length)) {
throw new \RuntimeException("For input string \"{$length}\"");
}
$lengthSet[] = (int)$length;
$lengthSet[] = (int) $length;
}
}
return $lengthSet;
Expand Down
4 changes: 1 addition & 3 deletions build/MetadataFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ class MetadataFilter
/**
* @param array<string[]> $blackList
*/
public function __construct(protected array $blackList = [])
{
}
public function __construct(protected array $blackList = []) {}

public static function forLiteBuild(): static
{
Expand Down
Loading

0 comments on commit 445b079

Please sign in to comment.