Skip to content

Commit

Permalink
fixup! fixup! use proper types in API (fossar#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
niol committed Jun 27, 2017
1 parent f81cd2d commit 27f2e47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/Sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function write() {

$return = [
'success' => true,
'id' => intval($id),
'id' => (int) $id,
'title' => $title
];

Expand Down
4 changes: 2 additions & 2 deletions daos/mysql/Statements.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function insert($query, array $params) {
\F3::get('db')->exec($query, $params);
$res = \F3::get('db')->exec('SELECT LAST_INSERT_ID() as lastid');

return intval($res[0]['lastid']);
return (int) $res[0]['lastid'];
}

/**
Expand Down Expand Up @@ -153,7 +153,7 @@ public function ensureRowTypes(array $rows, array $expectedRowTypes) {
if (array_key_exists($columnIndex, $row)) {
switch ($type) {
case \daos\PARAM_INT:
$value = intval($row[$columnIndex]);
$value = (int) $row[$columnIndex];
break;
case \daos\PARAM_BOOL:
if ($row[$columnIndex] == '1') {
Expand Down
2 changes: 1 addition & 1 deletion daos/sqlite/Statements.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function insert($query, array $params) {
\F3::get('db')->exec($query, $params);
$res = \F3::get('db')->exec('SELECT last_insert_rowid() as lastid');

return intval($res[0]['lastid']);
return (int) $res[0]['lastid'];
}

/**
Expand Down

0 comments on commit 27f2e47

Please sign in to comment.