packagist nunomaduro/larastan v3.14.0
3.14.0

3 hours ago

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() and Arr::pull(), including dot notation and default values, and track array keys removed by Arr::pull(), by @canvural in #2635.
  • Report definitely missing keys in Arr::get() and Arr::pull() by @canvural in #2635.
  • Load Redis facade and connection stubs for the configured PhpRedis or Predis driver, with a redisDriver override, 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 @return PHPDocs 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 is null and generalizeEnvReturnType is 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 in toArray() 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 groupBy calls by @mkantautas in #2620.
  • Accept a per-page callback in Eloquent paginate() by @mkantautas in #2619.
  • Accept a Cursor object in relation cursorPaginate() calls by @mkantautas in #2627.
  • Check model properties in fillAndInsert(), fillAndInsertOrIgnore(), fillAndInsertGetId(), and fillForInsert() 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 TypeNode API by @Xauele in 1509cc6.
  • Keep dispatch argument checking compatible with PHPStan's updated FunctionCallParametersCheck API by @canvural in #2633.

New Contributors

Full Changelog: v3.13.2...v3.14.0

Don't miss a new larastan release

NewReleases is sending notifications on new releases.