Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 Deprecation fix #13

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(array $data = [])
*
* @return int The value
*/
public function getInt(string $key, int $default = null): int
public function getInt(string $key, ?int $default = null): int
{
$value = $this->find($key, $default);

Expand All @@ -54,7 +54,7 @@ public function getInt(string $key, int $default = null): int
*
* @return int|null The value
*/
public function findInt(string $key, int $default = null)
public function findInt(string $key, ?int $default = null)
{
$value = $this->find($key, $default);

Expand All @@ -75,7 +75,7 @@ public function findInt(string $key, int $default = null)
*
* @return string The value
*/
public function getString(string $key, string $default = null): string
public function getString(string $key, ?string $default = null): string
{
$value = $this->find($key, $default);

Expand All @@ -94,7 +94,7 @@ public function getString(string $key, string $default = null): string
*
* @return string|null The value
*/
public function findString(string $key, string $default = null)
public function findString(string $key, ?string $default = null)
{
$value = $this->find($key, $default);

Expand All @@ -115,7 +115,7 @@ public function findString(string $key, string $default = null)
*
* @return array<mixed> The value
*/
public function getArray(string $key, array $default = null): array
public function getArray(string $key, ?array $default = null): array
{
$value = $this->find($key, $default);

Expand All @@ -134,7 +134,7 @@ public function getArray(string $key, array $default = null): array
*
* @return array<mixed>|null The value
*/
public function findArray(string $key, array $default = null)
public function findArray(string $key, ?array $default = null)
{
$value = $this->find($key, $default);

Expand All @@ -155,7 +155,7 @@ public function findArray(string $key, array $default = null)
*
* @return float The value
*/
public function getFloat(string $key, float $default = null): float
public function getFloat(string $key, ?float $default = null): float
{
$value = $this->find($key, $default);

Expand All @@ -174,7 +174,7 @@ public function getFloat(string $key, float $default = null): float
*
* @return float|null The value
*/
public function findFloat(string $key, float $default = null)
public function findFloat(string $key, ?float $default = null)
{
$value = $this->find($key, $default);

Expand All @@ -195,7 +195,7 @@ public function findFloat(string $key, float $default = null)
*
* @return bool The value
*/
public function getBool(string $key, bool $default = null): bool
public function getBool(string $key, ?bool $default = null): bool
{
$value = $this->find($key, $default);

Expand All @@ -214,7 +214,7 @@ public function getBool(string $key, bool $default = null): bool
*
* @return bool|null The value
*/
public function findBool(string $key, bool $default = null)
public function findBool(string $key, ?bool $default = null)
{
$value = $this->find($key, $default);

Expand All @@ -235,7 +235,7 @@ public function findBool(string $key, bool $default = null)
*
* @return Chronos The value
*/
public function getChronos(string $key, Chronos $default = null): Chronos
public function getChronos(string $key, ?Chronos $default = null): Chronos
{
$value = $this->find($key, $default);

Expand All @@ -254,11 +254,11 @@ public function getChronos(string $key, Chronos $default = null): Chronos
* Get value as Chronos or null.
*
* @param string $key The key
* @param Chronos $default The default value
* @param Chronos|null $default The default value
*
* @return Chronos|null The value
*/
public function findChronos(string $key, Chronos $default = null)
public function findChronos(string $key, ?Chronos $default = null)
{
$value = $this->find($key, $default);

Expand Down