What's Changed
The new Arr::get() and Arr::pull() key check is enabled by default. Calls with definitely missing keys now report offsetAccess.notFound, including calls that provide a default value. PHP, Laravel, and PHPStan requirements are unchanged.
Added
- Infer return types for
Arr::get()andArr::pull(), including dot notation and default values, and track array keys removed byArr::pull(), by @canvural in #2635. - Report definitely missing keys in
Arr::get()andArr::pull()by @canvural in #2635. - Load Redis facade and connection stubs for the configured PhpRedis or Predis driver, with a
redisDriveroverride, by @canvural in #2626. - Re-analyse affected files when config files, migrations, or schema dumps are created, changed, or deleted by @canvural in #2631.
Fixed
- Resolve config values in the config file's own scope, including local variables and imports, by @canvural in aefbc03.
- Resolve config file
@returnPHPDocs using that file's imports, and avoid incorrect inference for missing keys or files with multiple returns, by @canvural in f0e6e1c, 73cd4c3, and 10e955b. - Preserve
env()'s possible return types when its default isnullandgeneralizeEnvReturnTypeis enabled by @canvural in bfcc01e. - Rerun unused-view and missing-translation checks when their input files change by @SanderMuller in #2630.
- Preserve
Arrayable<TKey, TValue>types intoArray()and correct model array key types by @liamduckett in #2254. - Support union and intersection return types from model
newCollection()methods by @ybai08 in #2604. - Accept unions of array shapes in
FormRequest::safe()by @aran112000 in #2637. - Only evaluate closures passed to
value(), preserving other callable values, by @APX403 in #2632. - Read
#[UseEloquentBuilder]from parent models and traits on Laravel 13.31 and newer by @APX403 in #2621. - Resolve a model subclass's factory using its own conventional factory name by @SanderMuller in #2625.
- Infer group key types for higher-order
groupBycalls by @mkantautas in #2620. - Accept a per-page callback in Eloquent
paginate()by @mkantautas in #2619. - Accept a
Cursorobject in relationcursorPaginate()calls by @mkantautas in #2627. - Check model properties in
fillAndInsert(),fillAndInsertOrIgnore(),fillAndInsertGetId(), andfillForInsert()by @uchimaki-vensley in #2601. - Read migration columns declared in arrow-function callbacks by @aka-tpayne in #2608.
- Resolve custom generic PHPDoc names through the
TypeNodeAPI by @Xauele in 1509cc6. - Keep dispatch argument checking compatible with PHPStan's updated
FunctionCallParametersCheckAPI by @canvural in #2633.
New Contributors
- @aka-tpayne made their first contribution in #2608.
- @aran112000 made their first contribution in #2637.
- @ybai08 made their first contribution in #2604.
Full Changelog: v3.13.2...v3.14.0