Taint accuracy for named arguments, plus three Eloquent and Collection narrowings.
Fixes
- 🛡️ Fix taint false positives when a value is passed as a named argument (#1396). Psalm attributes a named argument's taint to the parameter at its written position instead of the one it names (vimeo/psalm#11923), so an unrelated request value could be reported against a file, SQL, or HTML sink.
// sinkNamed(string $path = 'safe', string $label = 'x'), file sink on $path
sinkNamed(label: (string) $request->input('page'));
-// TaintedFile (before): the taint landed on $path, which never saw the request
+// no issue: the argument is attributed to $label- Narrow
AbstractPaginator::getCollection()andAbstractCursorPaginator::getCollection()toEloquent\Collectionwhen the paginator holds models (#1397). The 33 methods that exist only on the Eloquent collection (load*,find,fresh,modelKeys,toQuery, ...) are now reachable.
$users = User::paginate();
$users->getCollection()->load('posts');
-// UndefinedMethod (before): Support\Collection<int, User> has no load()
+// now resolves: Eloquent\Collection<int, User>- Add
select()stubs forCollection,LazyCollection, andEloquent\Collection(#1399), including theselect(null)branch and the variadic form.
$rows = collect([['a' => 1, 'b' => 2]])->select('a');
-// Collection<array-key, mixed>&static (before); select('a', 'b') reported TooManyArguments
+// Collection<array-key, array<array-key, mixed>>- Resolve
Auth::guard()andAuth::shouldUse()when the guard name is a string-backed enum case (#1405). Previously any non-literal argument dropped all narrowing back to the bare contract.
Auth::guard(Guards::Admin)->user();
-// Illuminate\Contracts\Auth\Guard (before)
+// now resolves through SessionGuard to the configured user modelChanges
<experimental value="true" />now also enablesfindSerializedQueuedModels, unless the project sets that flag explicitly (#1400).experimentalis the early-access switch for rules that are off by default and on their way to becoming default.
Full Changelog: v4.15.6...v4.15.7