Skip to content

Conversation

@nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Aug 25, 2021

Following the discussion on #38257, this pull request starts the work of introducing serious strong type definitions on Laravel core. What this pull request include:

  1. GitHub action job that validates/tests the type definitions.
  2. Improves type definitions of Support\Collection and Database\Eloquent\Collection.

1

generics_laravel_collections-3

What this pull request does not include:

  • Usage of this new type definitions on Database\Eloquent. In other words, collect(['string' => 1])->flip()->all() or collect()->map() is 100% static analyzable and understood by static analysis tools - PHPStorm + PHPStan + Psalm, but not yet User::all().

As the next step, going to improve the type definitions of Database\Eloquent. That's only possible now because of the this work we did with collections.

@nunomaduro nunomaduro force-pushed the feat/generic-collections branch from 893a2d5 to f409bbb Compare August 25, 2021 10:24
@taylorotwell taylorotwell merged commit b1de554 into master Aug 27, 2021
@taylorotwell taylorotwell deleted the feat/generic-collections branch August 27, 2021 14:01
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.

4 participants