Commit bdec861
Compute native callable parameters from array args for array_map and array_filter
For constant arrays passed to array_map/array_filter, the native types
are known (e.g. literal string unions), but the callback parameter's
native PHP type is just `callable` which loses this information.
Tag array_filter callbacks with the array expression (like ArrayMapArgVisitor
does for array_map), then compute native callable parameters from the actual
array arguments' native types in processClosureNode, processArrowFunctionNode,
and ClosureTypeResolver.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8e47fa3 commit bdec861
3 files changed
Lines changed: 33 additions & 5 deletions
File tree
- src
- Analyser
- ExprHandler/Helper
- Parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | | - | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
2717 | 2719 | | |
2718 | 2720 | | |
2719 | 2721 | | |
2720 | | - | |
| 2722 | + | |
| 2723 | + | |
2721 | 2724 | | |
2722 | 2725 | | |
2723 | 2726 | | |
| |||
2927 | 2930 | | |
2928 | 2931 | | |
2929 | 2932 | | |
2930 | | - | |
| 2933 | + | |
| 2934 | + | |
2931 | 2935 | | |
2932 | 2936 | | |
2933 | 2937 | | |
| |||
2957 | 2961 | | |
2958 | 2962 | | |
2959 | 2963 | | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
2960 | 2981 | | |
2961 | 2982 | | |
2962 | 2983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
0 commit comments