Skip to content

Commit b759f58

Browse files
committed
Upgrade coding standard
1 parent 418789f commit b759f58

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"require-dev": {
4444
"ext-xdebug": "*",
45-
"aplus/coding-standard": "^2.0",
45+
"aplus/coding-standard": "^2.8",
4646
"ergebnis/composer-normalize": "^2.25",
4747
"jetbrains/phpstorm-attributes": "^1.0",
4848
"phpmd/phpmd": "^2.13",

src/Language.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function addLines(string $locale, string $file, array $lines) : static
132132
*
133133
* @return string
134134
*/
135-
public function currency(float $value, string $currency, string $locale = null) : string
135+
public function currency(float $value, string $currency, ?string $locale = null) : string
136136
{
137137
// @phpstan-ignore-next-line
138138
return \NumberFormatter::create(
@@ -152,7 +152,7 @@ public function currency(float $value, string $currency, string $locale = null)
152152
*
153153
* @return string
154154
*/
155-
public function date(int $time, string $style = null, string $locale = null) : string
155+
public function date(int $time, ?string $style = null, ?string $locale = null) : string
156156
{
157157
if ($style && !\in_array($style, ['short', 'medium', 'long', 'full'], true)) {
158158
throw new InvalidArgumentException('Invalid date style format: ' . $style);
@@ -380,7 +380,7 @@ protected function isFindedLocale(string $locale) : bool
380380
*
381381
* @return string|null The rendered text or null if not found
382382
*/
383-
public function lang(string $line, array $args = [], string $locale = null) : ?string
383+
public function lang(string $line, array $args = [], ?string $locale = null) : ?string
384384
{
385385
[$file, $line] = \explode('.', $line, 2);
386386
return $this->render($file, $line, $args, $locale);
@@ -394,7 +394,7 @@ public function lang(string $line, array $args = [], string $locale = null) : ?s
394394
*
395395
* @return string
396396
*/
397-
public function ordinal(int $number, string $locale = null) : string
397+
public function ordinal(int $number, ?string $locale = null) : string
398398
{
399399
// @phpstan-ignore-next-line
400400
return \MessageFormatter::formatMessage(
@@ -418,7 +418,7 @@ public function render(
418418
string $file,
419419
string $line,
420420
array $args = [],
421-
string $locale = null
421+
?string $locale = null
422422
) : string {
423423
if (isset($this->debugCollector)) {
424424
$start = \microtime(true);
@@ -450,7 +450,7 @@ protected function getRenderedLine(
450450
string $file,
451451
string $line,
452452
array $args = [],
453-
string $locale = null
453+
?string $locale = null
454454
) : array {
455455
$locale ??= $this->getCurrentLocale();
456456
$text = $this->getLine($locale, $file, $line);
@@ -475,7 +475,7 @@ protected function getRenderedLine(
475475
*
476476
* @return bool True if the line is found, otherwise false
477477
*/
478-
public function hasLine(string $file, string $line, string $locale = null) : bool
478+
public function hasLine(string $file, string $line, ?string $locale = null) : bool
479479
{
480480
$locale ??= $this->getCurrentLocale();
481481
$text = $this->getLine($locale, $file, $line);
@@ -492,7 +492,7 @@ public function hasLine(string $file, string $line, string $locale = null) : boo
492492
*
493493
* @return string
494494
*/
495-
public function formatMessage(string $text, array $args = [], string $locale = null) : string
495+
public function formatMessage(string $text, array $args = [], ?string $locale = null) : string
496496
{
497497
$args = \array_map(static function ($arg) : string {
498498
return (string) $arg;
@@ -590,7 +590,7 @@ protected function reindex() : void
590590
*
591591
* @return static
592592
*/
593-
public function setFallbackLevel(FallbackLevel|int $level) : static
593+
public function setFallbackLevel(FallbackLevel | int $level) : static
594594
{
595595
if (\is_int($level)) {
596596
$level = FallbackLevel::from($level);

0 commit comments

Comments
 (0)