Skip to content

Commit 0e2a6a5

Browse files
committed
fix: variable types
PHPStan 1.9.0 reported errors.
1 parent 9dd92e0 commit 0e2a6a5

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

system/Database/SQLSRV/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function connect(bool $persistent = false)
141141
$errors = [];
142142

143143
foreach (sqlsrv_errors(SQLSRV_ERR_ERRORS) as $error) {
144-
$errors[] = preg_replace('/(\[.+\]\[.+\](?:\[.+\])?)(.+)/', '$2', $error['message']);
144+
$errors[] = (string) preg_replace('/(\[.+\]\[.+\](?:\[.+\])?)(.+)/', '$2', $error['message']);
145145
}
146146

147147
throw new DatabaseException(implode("\n", $errors));

system/HTTP/CURLRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ protected function setResponseHeaders(array $headers = [])
474474
}
475475

476476
if (isset($matches[2])) {
477-
$this->response->setStatusCode($matches[2], $matches[3] ?? null);
477+
$this->response->setStatusCode((int) $matches[2], $matches[3] ?? null);
478478
}
479479
}
480480
}

system/Helpers/text_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ function increment_string(string $str, string $separator = '_', int $first = 1):
598598
{
599599
preg_match('/(.+)' . preg_quote($separator, '/') . '([0-9]+)$/', $str, $match);
600600

601-
return isset($match[2]) ? $match[1] . $separator . ($match[2] + 1) : $str . $separator . $first;
601+
return isset($match[2]) ? $match[1] . $separator . ((int) $match[2] + 1) : $str . $separator . $first;
602602
}
603603
}
604604

system/Session/Handlers/MemcachedHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function open($path, $name): bool
103103
continue;
104104
}
105105

106-
if (! $this->memcached->addServer($match[1], $match[2], $match[3] ?? 0)) {
106+
if (! $this->memcached->addServer($match[1], (int) $match[2], $match[3] ?? 0)) {
107107
$this->logger->error('Could not add ' . $match[1] . ':' . $match[2] . ' to Memcached server pool.');
108108
} else {
109109
$serverList[] = $match[1] . ':' . $match[2];

0 commit comments

Comments
 (0)