Skip to content

Commit 475998c

Browse files
authored
Merge pull request #1 from pthreat/fix/empty-string
fix/empty-string - Fix empty string being interpreted as NULL
2 parents 66858ac + f928ed0 commit 475998c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ All changes to this project are documented in this file.
44

55
This project adheres to Semantic Versioning.
66

7-
[vx.x.x] - 2022-09-19
7+
[v1.0.1] - 2022-09-19
8+
9+
## Changed
10+
11+
- Fixed misinterpretation of empty strings as NULL
12+
13+
[v1.0.0] - 2022-09-19
814

915
## Changed
1016

src/Builder/Syntax/PlaceholderWriter.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ protected function setValidSqlValue($value)
8080
*/
8181
protected function writeNullSqlString($value)
8282
{
83-
if (\is_null($value) || (\is_string($value) && empty($value))) {
84-
$value = $this->writeNull();
85-
}
86-
87-
return $value;
83+
return null === $value ? null : $value;
8884
}
8985

9086
/**

0 commit comments

Comments
 (0)