Skip to content

Commit 2543881

Browse files
committed
Update dependencies and fix risky comparisons
1 parent e349e0c commit 2543881

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"require": {
1313
"php": ">=7.4",
1414
"ext-json": "*",
15-
"psr/http-message": "^1.0",
15+
"psr/http-message": "^1.1 || ^2.0",
1616
"shrikeh/teapot": "^2.3.1",
1717
"theodorejb/peachy-sql": "^6.1"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^9.6",
21-
"psalm/plugin-phpunit": "^0.18.4",
22-
"vimeo/psalm": "^5.15"
21+
"psalm/plugin-phpunit": "^0.19",
22+
"vimeo/psalm": "^5.26"
2323
},
2424
"autoload": {
2525
"psr-4": {"theodorejb\\Phaster\\": "src/"}

src/Helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ public static function mapRows(\Generator $rows, array $fieldProps): array
8484
$nullParents = [];
8585

8686
foreach ($aliasMap as $colName => $prop) {
87-
if ($prop->getValue) {
87+
if ($prop->getValue !== null) {
8888
/** @var mixed $value */
8989
$value = ($prop->getValue)($row);
9090
} else {
9191
/** @var mixed $value */
9292
$value = $row[$colName];
9393

94-
if ($prop->type) {
94+
if ($prop->type !== null) {
9595
settype($value, $prop->type);
9696
} elseif (is_string($value) && $prop->timeZone !== false) {
9797
$value = (new \DateTimeImmutable($value, $prop->timeZone))->format(\DateTime::ATOM);

test/src/DbConnector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public static function getMysqlConn(): mysqli
4141

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

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

4848
self::createMysqlTestTable(self::$mysqlConn);

0 commit comments

Comments
 (0)