diff options
author | Mitch <[email protected]> | 2014-06-23 22:15:02 +1000 |
---|---|---|
committer | Mitch <[email protected]> | 2014-06-23 22:15:02 +1000 |
commit | 2600268f6cb0d6d4ec4252a63e72b66e920e242b (patch) | |
tree | 044b08be479e5582458dddbdd0d144adcef74375 | |
parent | 91e8e2c936a16ed3e2e3ff3c27f9d4d7eaedaa2f (diff) |
Swap switch for if/else
-rw-r--r-- | idiorm.php | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -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); |