Skip to content

Commit

Permalink
Update dependencies and fix risky comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
theodorejb committed Sep 10, 2024
1 parent e349e0c commit 2543881
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"require": {
"php": ">=7.4",
"ext-json": "*",
"psr/http-message": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"shrikeh/teapot": "^2.3.1",
"theodorejb/peachy-sql": "^6.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.15"
"psalm/plugin-phpunit": "^0.19",
"vimeo/psalm": "^5.26"
},
"autoload": {
"psr-4": {"theodorejb\\Phaster\\": "src/"}
Expand Down
4 changes: 2 additions & 2 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ public static function mapRows(\Generator $rows, array $fieldProps): array
$nullParents = [];

foreach ($aliasMap as $colName => $prop) {
if ($prop->getValue) {
if ($prop->getValue !== null) {
/** @var mixed $value */
$value = ($prop->getValue)($row);
} else {
/** @var mixed $value */
$value = $row[$colName];

if ($prop->type) {
if ($prop->type !== null) {
settype($value, $prop->type);
} elseif (is_string($value) && $prop->timeZone !== false) {
$value = (new \DateTimeImmutable($value, $prop->timeZone))->format(\DateTime::ATOM);
Expand Down
4 changes: 2 additions & 2 deletions test/src/DbConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public static function getMysqlConn(): mysqli

self::$mysqlConn = new mysqli($c->getMysqlHost(), $c->getMysqlUser(), $c->getMysqlPassword(), $c->getMysqlDatabase(), $dbPort);

if (self::$mysqlConn->connect_error) {
throw new Exception('Failed to connect to MySQL: (' . self::$mysqlConn->connect_errno . ') ' . self::$mysqlConn->connect_error);
if (self::$mysqlConn->connect_error !== null) {
throw new Exception('Failed to connect to MySQL: ' . self::$mysqlConn->connect_error);
}

self::createMysqlTestTable(self::$mysqlConn);
Expand Down

0 comments on commit 2543881

Please sign in to comment.