Skip to content

Deprecate array_first/array_last helpers in favor of Arr::first/Arr::last#24

Open
agissept wants to merge 3 commits into
masterfrom
deprecate-array-first-last
Open

Deprecate array_first/array_last helpers in favor of Arr::first/Arr::last#24
agissept wants to merge 3 commits into
masterfrom
deprecate-array-first-last

Conversation

@agissept

Copy link
Copy Markdown
Member

Summary

  • Replace all internal usages of array_first()/array_last() with Arr::first()/Arr::last()
  • Keep the helper functions available but mark them @deprecated
  • Add use Illuminate\Support\Arr; imports where missing

Tests in tests/Support/SupportHelpersTest.php intentionally still call the deprecated helpers to verify they keep working.

Test plan

  • Full test suite passes: 1619 tests OK (same as master)

🤖 Generated with Claude Code

agissept and others added 2 commits July 21, 2026 17:36
…irst/Arr::last

Replace all internal usages with Arr::first/Arr::last. The helper
functions remain available but are marked @deprecated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PHP 8.5 deprecates using null as an array offset. $namespace is null
for non-namespaced config keys, so guard the afterLoad lookup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@agissept
agissept force-pushed the deprecate-array-first-last branch from f8bc664 to eb7c898 Compare July 21, 2026 10:36
PHP 8.5 deprecates using null as an array offset. groupBy's key can
resolve to null (closure or data_get returning null), so coalesce to
an empty string.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant