Skip to content

Commit 44b4a7a

Browse files
committed
fix: restore compatibility with PHP 7.4, fix phpstan errors
1 parent 3272320 commit 44b4a7a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.docker/PHP-Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-fpm
1+
FROM php:7.4-fpm
22

33
RUN apt-get update
44
RUN apt-get --yes --no-install-recommends install \
@@ -32,7 +32,7 @@ RUN docker-php-ext-install -j$(nproc) \
3232
COPY build/php/opcache.ini /usr/local/etc/php/conf.d/
3333
COPY build/php/custom.ini /usr/local/etc/php/conf.d/
3434

35-
RUN pecl install xdebug-3.4.0 && docker-php-ext-enable xdebug
35+
RUN pecl install xdebug-3.1.6 && docker-php-ext-enable xdebug
3636

3737
RUN php --version
3838

src/Redmine/Client/NativeCurlClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private function runRequest(string $method, string $path, string $body = '', str
324324
*
325325
* BC for PHP 7.4: Do not add the return type because CurlHandle was introduced in PHP 8.0
326326
*
327-
* @return \CurlHandle a cURL handle on success, <b>FALSE</b> on errors
327+
* @return mixed a cURL handle on success, <b>FALSE</b> on errors
328328
*/
329329
private function createCurl(string $method, string $path, string $body = '', string $contentType = '')
330330
{

tests/Behat/Bootstrap/FeatureContext.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ public static function clean(AfterSuiteScope $scope): void
7474

7575
private Response $lastResponse;
7676

77-
private mixed $lastReturn;
77+
/**
78+
* @var mixed
79+
*/
80+
private $lastReturn;
7881

7982
/**
8083
* @var array<mixed>
@@ -112,7 +115,7 @@ private function getNativeCurlClient(): NativeCurlClient
112115
return $this->client;
113116
}
114117

115-
private function registerClientResponse(mixed $lastReturn, Response $lastResponse): void
118+
private function registerClientResponse($lastReturn, Response $lastResponse): void
116119
{
117120
unset($this->lastReturnAsArray);
118121
$this->lastReturn = $lastReturn;
@@ -371,7 +374,7 @@ private function getLastReturnAsArray(): array
371374
/**
372375
* Get item from an array by key supporting "dot" notation.
373376
*/
374-
private function getItemFromArray(array $array, $key): mixed
377+
private function getItemFromArray(array $array, $key)
375378
{
376379
if ($key === null) {
377380
return $array;

tests/RedmineExtension/RedmineInstance.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ private function saveMigratedDatabase(): void
226226
private function restoreFromMigratedDatabase(): void
227227
{
228228
$workingDB = new SQLite3($this->dataPath . $this->workingDB);
229+
$workingDB->busyTimeout(1000);
229230

230231
$migratedDB = new SQLite3($this->dataPath . $this->migratedDB);
231232

0 commit comments

Comments
 (0)