Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 12, 2020
1 parent 53f3a81 commit b3d0da1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,9 @@ protected function wrapJsonBooleanValue($value)
protected function wrapJsonPathAttributes($path)
{
return array_map(function ($attribute) {
if (\strval(\intval($attribute)) === $attribute) {
return $attribute;
}

return "'$attribute'";
return filter_var($attribute, FILTER_VALIDATE_INT) !== false
? $attribute
: "'$attribute'";
}, $path);
}
}

0 comments on commit b3d0da1

Please sign in to comment.