Skip to content

Commit e7f8de7

Browse files
committed
type convertion check added
1 parent f19cbc6 commit e7f8de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Schema/Convention.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function encode($type, $value)
4343
}
4444

4545
if ($type == 'integer') {
46-
return +$value;
46+
return $value ? +$value : 0;
4747
}
4848

4949
if (is_null($value)) {
@@ -60,7 +60,7 @@ public function encode($type, $value)
6060
public function decode($type, $value)
6161
{
6262
if ($type == 'integer') {
63-
return +$value;
63+
return $value ? +$value : 0;
6464
}
6565

6666
return $value;

0 commit comments

Comments
 (0)