summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--idiorm.php24
1 files changed, 8 insertions, 16 deletions
diff --git a/idiorm.php b/idiorm.php
index 6ef5911..80e9a4d 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -413,22 +413,14 @@
$time = microtime(true);
foreach ($parameters as $key => &$param) {
- switch (true) {
- case is_null($param):
- $type = PDO::PARAM_NULL;
- break;
-
- case is_bool($param):
- $type = PDO::PARAM_BOOL;
- break;
-
- case is_int($param):
- $type = PDO::PARAM_INT;
- break;
-
- default:
- $type = PDO::PARAM_STR;
- break;
+ if (is_null($param)) {
+ $type = PDO::PARAM_NULL;
+ } else if (is_bool($param)) {
+ $type = PDO::PARAM_BOOL;
+ } else if (is_int($param)) {
+ $type = PDO::PARAM_INT;
+ } else {
+ $type = PDO::PARAM_STR;
}
$statement->bindParam(is_int($key) ? ++$key : $key, $param, $type);