File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed
src/core/etl/src/Flow/ETL/Function Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,17 @@ public function __construct(
23
23
24
24
public function eval (Row $ row ) : mixed
25
25
{
26
- $ values = \array_map (fn (ScalarFunction |string $ string ) : mixed => \is_string ($ string ) ? $ string : Caster::default ()->to (type_string (true ))->value ($ string ->eval ($ row )), $ this ->refs );
27
-
26
+ /** @var array<string> $concatValues */
28
27
$ concatValues = [];
29
28
30
- foreach ($ values as $ value ) {
29
+ foreach ($ this ->refs as $ value ) {
30
+ $ value = \is_string ($ value ) ? $ value : Caster::default ()->to (type_string (true ))->value ($ value ->eval ($ row ));
31
+
31
32
if (\is_string ($ value )) {
32
33
$ concatValues [] = $ value ;
33
34
}
34
35
}
35
36
36
- if (\count ($ concatValues ) === 0 ) {
37
- return '' ;
38
- }
39
-
40
- /** @var array<string> $values */
41
37
return \implode ('' , $ concatValues );
42
38
}
43
39
}
Original file line number Diff line number Diff line change @@ -30,21 +30,17 @@ public function eval(Row $row) : mixed
30
30
return '' ;
31
31
}
32
32
33
- $ values = \array_map (fn (ScalarFunction |string $ string ) : mixed => \is_string ($ string ) ? $ string : Caster::default ()->to (type_string (true ))->value ($ string ->eval ($ row )), $ this ->refs );
34
-
33
+ /** @var array<string> $concatValues */
35
34
$ concatValues = [];
36
35
37
- foreach ($ values as $ value ) {
36
+ foreach ($ this ->refs as $ value ) {
37
+ $ value = \is_string ($ value ) ? $ value : Caster::default ()->to (type_string (true ))->value ($ value ->eval ($ row ));
38
+
38
39
if (\is_string ($ value )) {
39
40
$ concatValues [] = $ value ;
40
41
}
41
42
}
42
43
43
- if (\count ($ concatValues ) === 0 ) {
44
- return '' ;
45
- }
46
-
47
- /** @var array<string> $values */
48
44
return \implode ($ separator , $ concatValues );
49
45
}
50
46
}
You can’t perform that action at this time.
0 commit comments