Skip to content

Commit c0857b0

Browse files
committed
PHP 8.4
1 parent 4543a43 commit c0857b0

11 files changed

Lines changed: 15 additions & 15 deletions

lib/CurrencyFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class CurrencyFormatter extends NumberFormatter
2828
public function format(
2929
$number,
3030
$pattern,
31-
Symbols $symbols = null,
31+
?Symbols $symbols = null,
3232
string $currencySymbol = self::DEFAULT_CURRENCY_SYMBOL
3333
): string {
3434
return str_replace(

lib/CurrencyNotDefined.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private function get_currency_code(): string
3838
return $this->currency_code;
3939
}
4040

41-
public function __construct(string $currency_code, string $message = null, Throwable $previous = null)
41+
public function __construct(string $currency_code, ?string $message = null, ?Throwable $previous = null)
4242
{
4343
$this->currency_code = $currency_code;
4444

lib/Locale.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private function resolve_localize_constructor($source): ?callable
199199
*
200200
* @see LocalizedNumberFormatter::format
201201
*/
202-
public function format_number($number, string $pattern = null): string
202+
public function format_number($number, ?string $pattern = null): string
203203
{
204204
return $this->number_formatter->format($number, $pattern);
205205
}
@@ -209,7 +209,7 @@ public function format_number($number, string $pattern = null): string
209209
*
210210
* @see LocalizedNumberFormatter::format
211211
*/
212-
public function format_percent($number, string $pattern = null): string
212+
public function format_percent($number, ?string $pattern = null): string
213213
{
214214
return $this->number_formatter->format(
215215
$number,

lib/LocalizedCurrency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function get_name(): string
4343
*
4444
* @param int|null $count Used for pluralization.
4545
*/
46-
public function name_for(int $count = null): string
46+
public function name_for(?int $count = null): string
4747
{
4848
$offset = 'displayName';
4949

lib/LocalizedDateTime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function __toString(): string
136136
*
137137
* @throws \Exception
138138
*/
139-
public function format(string $pattern = null): string
139+
public function format(?string $pattern = null): string
140140
{
141141
return $this->formatter->format($this->target, $pattern);
142142
}

lib/LocalizedNumberFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class LocalizedNumberFormatter extends LocalizedObject implements Formatter
2323
*
2424
* @param float|int $number The number to format.
2525
*/
26-
public function __invoke($number, string $pattern = null): string
26+
public function __invoke($number, ?string $pattern = null): string
2727
{
2828
return $this->format($number, $pattern);
2929
}
@@ -33,7 +33,7 @@ public function __invoke($number, string $pattern = null): string
3333
*
3434
* @param float|int $number The number to format.
3535
*/
36-
public function format($number, string $pattern = null): string
36+
public function format($number, ?string $pattern = null): string
3737
{
3838
$numbers = $this->locale->numbers;
3939

lib/Number.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static public function round_to($number, int $precision): float
5555
* `$number` has no decimal separator. The fractional part is returned as a string to preserve '03' from
5656
* '1.03'.
5757
*/
58-
static public function parse($number, int $precision = null): array
58+
static public function parse($number, ?int $precision = null): array
5959
{
6060
if ($precision === null)
6161
{

lib/NumberFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class NumberFormatter implements Formatter
2727
* @param float|int $number The number to be formatted.
2828
* @param string $pattern The pattern used to format the number.
2929
*/
30-
public function __invoke($number, string $pattern, Symbols $symbols = null): string
30+
public function __invoke($number, string $pattern, ?Symbols $symbols = null): string
3131
{
3232
return $this->format($number, $pattern, $symbols);
3333
}
@@ -41,7 +41,7 @@ public function __invoke($number, string $pattern, Symbols $symbols = null): str
4141
* @param float|int $number The number to be formatted.
4242
* @param string|NumberPattern $pattern The pattern used to format the number.
4343
*/
44-
public function format($number, $pattern, Symbols $symbols = null): string
44+
public function format($number, $pattern, ?Symbols $symbols = null): string
4545
{
4646
if (!$pattern instanceof NumberPattern)
4747
{

lib/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function fetch(string $path): array
147147
*
148148
* @see NumberFormatter::format()
149149
*/
150-
public function format_number($number, string $pattern, Symbols $symbols = null): string
150+
public function format_number($number, string $pattern, ?Symbols $symbols = null): string
151151
{
152152
return $this->number_formatter->format($number, $pattern, $symbols);
153153
}
@@ -162,7 +162,7 @@ public function format_number($number, string $pattern, Symbols $symbols = null)
162162
public function format_currency(
163163
$number,
164164
string $pattern,
165-
Symbols $symbols = null,
165+
?Symbols $symbols = null,
166166
string $currencySymbol = CurrencyFormatter::DEFAULT_CURRENCY_SYMBOL
167167
): string {
168168
return $this->currency_formatter->format($number, $pattern, $symbols, $currencySymbol);

lib/ResourceNotFound.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private function get_path(): string
3737
return $this->path;
3838
}
3939

40-
public function __construct(string $path, int $code = 500, Throwable $previous = null)
40+
public function __construct(string $path, int $code = 500, ?Throwable $previous = null)
4141
{
4242
$this->path = $path;
4343

0 commit comments

Comments
 (0)