8000 [12.x] Typed getters for Arr helper by tibbsa · Pull Request #55567 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[12.x] Typed getters for Arr helper #55567

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

Merged
merged 6 commits into from
Apr 29, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
cleanup: remove nullable returns (not possible)
  • Loading branch information
tibbsa committed Apr 26, 2025
commit 65024f10806220c5b718ab7ffc30549d85180abf
10 changes: 5 additions & 5 deletions src/Illuminate/Collections/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function add($array, $key, $value)
/**
* Get an array item from an array using "dot" notation.
*/
public static function array(ArrayAccess|array $array, string|int|null $key, ?array $default = null): ?array
public static function array(ArrayAccess|array $array, string|int|null $key, ?array $default = null): array
{
$value = Arr::get($array, $key, $default);

Expand All @@ -59,7 +59,7 @@ public static function array(ArrayAccess|array $array, string|int|null $key, ?ar
/**
* Get a boolean item from an array using "dot" notation.
*/
public static function boolean(ArrayAccess|array $array, string|int|null $key, ?bool $default = null): ?bool
public static function boolean(ArrayAccess|array $array, string|int|null $key, ?bool $default = null): bool
{
$value = Arr::get($array, $key, $default);

Expand Down Expand Up @@ -321,7 +321,7 @@ public static function flatten($array, $depth = INF)
/**
* Get a float item from an array using "dot" notation.
*/
public static function float(ArrayAccess|array $array, string|int|null $key, ?float $default = null): ?float
public static function float(ArrayAccess|array $array, string|int|null $key, ?float $default = null): float
{
$value = Arr::get($array, $key, $default);

Expand Down Expand Up @@ -484,7 +484,7 @@ public static function hasAny($array, $keys)
/**
* Get an integer item from an array using "dot" notation.
*/
public static function integer(ArrayAccess|array $array, string|int|null $key, ?int $default = null): ?int
public static function integer(ArrayAccess|array $array, string|int|null $key, ?int $default = null): int
{
$value = Arr::get($array, $key, $default);

Expand Down Expand Up @@ -973,7 +973,7 @@ public static function sortRecursiveDesc($array, $options = SORT_REGULAR)
/**
* Get a string item from an array using "dot" notation.
*/
public static function string(ArrayAccess|array $array, string|int|null $key, ?string $default = null): ?string
public static function string(ArrayAccess|array $array, string|int|null $key, ?string $default = null): string
{
$value = Arr::get($array, $key, $default);

Expand Down
0