Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/SpatieLaravelData/Rules/ValidTypeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function processNode(Node $node, Scope $scope): array
// Flatten from a list of calls pr. file, to just a list of calls.
->flatten(1)
->map(Call::unserialize(...))
// Make sure the rule does not crash in case a specific data class has not been analyzed - This can happen with data classes in the vendor folder
->filter(fn (Call $call) => isset($classCollector[$call->target]))
// Check each call for errors
->map(fn (Call $call) => $this->compareTypes($call, $castCollector, $classCollector[$call->target]))
// Flatten from a list of errors pr. call, to just a list of errors.
Expand Down