Skip to content

Commit

Permalink
feat: use strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
tbreuss committed Feb 9, 2024
1 parent d660b34 commit 2cf1449
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/PDO.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace tebe;

/**
Expand Down Expand Up @@ -192,13 +194,13 @@ public function query(string $query, mixed ...$fetchModeArgs): PDOResult|false
*/
public function quote(array|string|int|float|null $value, int $type = self::PARAM_STR): string|false
{
$value = $value ?? '';

if (!is_array($value)) {
$value = strval($value ?? '');
return $this->pdo->quote($value, $type);
}

foreach ($value as $k => $v) {
$v = strval($v ?? '');
$value[$k] = $this->pdo->quote($v, $type);
}

Expand Down
2 changes: 2 additions & 0 deletions src/PDOParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace tebe;

use PDOException;
Expand Down
2 changes: 2 additions & 0 deletions src/PDOResult.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace tebe;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/PDOStatement.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace tebe;

/**
Expand Down

0 comments on commit 2cf1449

Please sign in to comment.