Skip to content

Commit 2fa0bd4

Browse files
authored
Merge pull request #16 from php-etl/feature/constant-mapper-null-value
Enabled null type for the constant mapper
2 parents a2f6e0a + 9195da6 commit 2fa0bd4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Mapping/Field/ConstantValueMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function compileValue(mixed $value): Node\Expr
6767
);
6868
}
6969

70+
if (is_null($value)) {
71+
return new Node\Expr\ConstFetch(
72+
name: new Node\Name(name: 'null'),
73+
);
74+
}
75+
7076
if (is_int($value)) {
7177
return new Node\Scalar\LNumber(value: $value);
7278
}

0 commit comments

Comments
 (0)