diff --git a/db/migrations/2018_10_01_000000_create_users_tables.php b/db/migrations/2018_10_01_000000_create_users_tables.php
index 1a847465..d2fee72e 100644
--- a/db/migrations/2018_10_01_000000_create_users_tables.php
+++ b/db/migrations/2018_10_01_000000_create_users_tables.php
@@ -93,7 +93,7 @@ class CreateUsersTables extends Migration
'password' => $data->Passwort,
'email' => $data->email,
'api_key' => $data->api_key,
- 'last_login_at' => Carbon::createFromTimestamp($data->lastLogIn),
+ 'last_login_at' => $data->lastLogIn ? Carbon::createFromTimestamp($data->lastLogIn) : null,
]);
$user->setAttribute('id', $data->UID);
if (!in_array($data->CreateDate, $emptyDates)) {
diff --git a/docker/Dockerfile b/docker/Dockerfile
index c1c334ef..b6046ecc 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -28,7 +28,7 @@ COPY --from=composer /app/composer.lock /app/
RUN find /app/storage/ -type f -not -name VERSION -exec rm {} \;
# Build the PHP container
-FROM php:8.0-fpm-alpine
+FROM php:8-fpm-alpine
WORKDIR /var/www
RUN apk add --no-cache icu-dev && \
docker-php-ext-install intl pdo_mysql
diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile
index fc5e489a..cc89b9f4 100644
--- a/docker/dev/Dockerfile
+++ b/docker/dev/Dockerfile
@@ -1,5 +1,5 @@
# Engelsystem PHP FPM development image including Xdebug
-FROM php:8.0-fpm-alpine AS es_php_fpm
+FROM php:8-fpm-alpine AS es_php_fpm
WORKDIR /var/www
RUN apk add --no-cache icu-dev $PHPIZE_DEPS && \
pecl install pcov xdebug && \
diff --git a/includes/sys_form.php b/includes/sys_form.php
index 9655935c..f96da233 100644
--- a/includes/sys_form.php
+++ b/includes/sys_form.php
@@ -11,7 +11,7 @@ use Carbon\Carbon;
*/
function form_hidden($name, $value)
{
- return '';
+ return '';
}
/**
@@ -24,7 +24,7 @@ function form_hidden($name, $value)
*/
function form_spinner($name, $label, $value)
{
- $value = htmlspecialchars($value);
+ $value = htmlspecialchars((string)$value);
return form_element($label, '
@@ -69,7 +69,7 @@ function form_date($name, $label, $value, $start_date = '', $end_date = '')
return form_element($label, '
- '
+ '
. '' . icon('grid-3x3-gap-fill') . '
', $dom_id);
@@ -178,7 +178,7 @@ function form_checkbox($name, $label, $selected, $value = 'checked', $html_id =
}
return '
';
@@ -196,7 +196,7 @@ function form_checkbox($name, $label, $selected, $value = 'checked', $html_id =
function form_radio($name, $label, $selected, $value)
{
return '
'
- . '
';
@@ -268,7 +268,7 @@ function form_text($name, $label, $value, $disabled = false, $maxlength = null,
return form_element(
$label,
'
',
+ . '" value="' . htmlspecialchars((string)$value) . '"' . $maxlength . $disabled . $autocomplete . '/>',
'form_' . $name,
$class
);
@@ -288,7 +288,7 @@ function form_text_placeholder($name, $placeholder, $value, $disabled = false)
$disabled = $disabled ? ' disabled="disabled"' : '';
return form_element('',
'
'
);
}
@@ -313,7 +313,7 @@ function form_email($name, $label, $value, $disabled = false, $autocomplete = nu
return form_element(
$label,
'
',
+ . htmlspecialchars((string)$value) . '" ' . $disabled . $autocomplete . $maxlength . '/>',
'form_' . $name
);
}
@@ -391,7 +391,7 @@ function form_textarea($name, $label, $value, $disabled = false)
return form_element(
$label,
'
',
+ . $name . '" ' . $disabled . '>' . htmlspecialchars((string)$value) . '',
'form_' . $name
);
}
diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php
index ef6d1597..692bb590 100644
--- a/includes/view/AngelTypes_view.php
+++ b/includes/view/AngelTypes_view.php
@@ -403,7 +403,7 @@ function AngelType_view_info(
$info[] = '
' . __('Description') . '
';
$parsedown = new Parsedown();
if ($angeltype['description'] != '') {
- $info[] = $parsedown->parse($angeltype['description']);
+ $info[] = $parsedown->parse((string)$angeltype['description']);
}
list($supporters, $members_confirmed, $members_unconfirmed) = AngelType_view_members(
@@ -561,7 +561,7 @@ function AngelTypes_about_view_angeltype($angeltype)
);
}
if ($angeltype['description'] != '') {
- $html .= $parsedown->parse($angeltype['description']);
+ $html .= $parsedown->parse((string)$angeltype['description']);
}
$html .= '
';
diff --git a/includes/view/Rooms_view.php b/includes/view/Rooms_view.php
index a2430729..10d0f723 100644
--- a/includes/view/Rooms_view.php
+++ b/includes/view/Rooms_view.php
@@ -24,7 +24,7 @@ function Room_view(Room $room, ShiftsFilterRenderer $shiftsFilterRenderer, Shift
if ($room->description) {
$description = '
' . __('Description') . '
';
$parsedown = new Parsedown();
- $description .= $parsedown->parse($room->description);
+ $description .= $parsedown->parse((string)$room->description);
}
$tabs = [];
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index 5a4b1322..d8e0510c 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -98,7 +98,7 @@ function ShiftType_view($shifttype, $angeltype)
)
]),
heading(__('Description'), 2),
- $parsedown->parse($shifttype['description'])
+ $parsedown->parse((string)$shifttype['description'])
], true);
}
diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php
index e4a2df6c..859c723e 100644
--- a/includes/view/Shifts_view.php
+++ b/includes/view/Shifts_view.php
@@ -176,8 +176,8 @@ function Shift_view($shift, $shifttype, Room $room, $angeltypes_source, ShiftSig
]),
div('col-sm-6', [
'
' . __('Description') . '
',
- $parsedown->parse($shifttype['description']),
- $parsedown->parse($shift['description']),
+ $parsedown->parse((string)$shifttype['description']),
+ $parsedown->parse((string)$shift['description']),
])
]);
diff --git a/src/Helpers/ConfigureEnvironmentServiceProvider.php b/src/Helpers/ConfigureEnvironmentServiceProvider.php
index 1660de1e..6722ce55 100644
--- a/src/Helpers/ConfigureEnvironmentServiceProvider.php
+++ b/src/Helpers/ConfigureEnvironmentServiceProvider.php
@@ -32,7 +32,7 @@ class ConfigureEnvironmentServiceProvider extends ServiceProvider
*/
protected function setTimeZone(CarbonTimeZone $timeZone)
{
- ini_set('date.timezone', $timeZone);
+ ini_set('date.timezone', (string)$timeZone);
date_default_timezone_set($timeZone);
}
diff --git a/src/Http/SessionHandlers/AbstractHandler.php b/src/Http/SessionHandlers/AbstractHandler.php
index 135d0d43..651b8b61 100644
--- a/src/Http/SessionHandlers/AbstractHandler.php
+++ b/src/Http/SessionHandlers/AbstractHandler.php
@@ -43,7 +43,8 @@ abstract class AbstractHandler implements SessionHandlerInterface
* @param int $maxLifetime
* @return bool
*/
- public function gc($maxLifetime): bool
+ #[\ReturnTypeWillChange]
+ public function gc($maxLifetime)
{
return true;
}
diff --git a/src/Http/SessionHandlers/DatabaseHandler.php b/src/Http/SessionHandlers/DatabaseHandler.php
index 8df70287..dafdaa89 100644
--- a/src/Http/SessionHandlers/DatabaseHandler.php
+++ b/src/Http/SessionHandlers/DatabaseHandler.php
@@ -74,7 +74,7 @@ class DatabaseHandler extends AbstractHandler
/**
* {@inheritdoc}
*/
- public function gc($maxLifetime): bool
+ public function gc($maxLifetime)
{
$timestamp = $this->getCurrentTimestamp(-$maxLifetime);
diff --git a/src/Logger/Logger.php b/src/Logger/Logger.php
index e3d3cacd..ee4a9854 100644
--- a/src/Logger/Logger.php
+++ b/src/Logger/Logger.php
@@ -72,7 +72,7 @@ class Logger extends AbstractLogger
}
// replace the values of the message
- $message = str_replace('{' . $key . '}', $val, $message);
+ $message = str_replace('{' . $key . '}', (string)$val, $message);
}
return $message;
diff --git a/src/Middleware/ErrorHandler.php b/src/Middleware/ErrorHandler.php
index a3bd6f7b..6caae3c9 100644
--- a/src/Middleware/ErrorHandler.php
+++ b/src/Middleware/ErrorHandler.php
@@ -77,7 +77,7 @@ class ErrorHandler implements MiddlewareInterface
$statusCode = $response->getStatusCode();
$contentType = $response->getHeader('content-type');
$contentType = array_shift($contentType);
- if (!$contentType && strpos($response->getBody(), 'getBody() ?? '', 'fromJson($value);
+ $value = $value ? $this->fromJson($value) : null;
/** @see \Illuminate\Database\Eloquent\Concerns\HasAttributes::castAttribute */
if (!empty($value)) {
diff --git a/tests/Unit/Models/EventConfigTest.php b/tests/Unit/Models/EventConfigTest.php
index 76b30061..ebc5e827 100644
--- a/tests/Unit/Models/EventConfigTest.php
+++ b/tests/Unit/Models/EventConfigTest.php
@@ -78,6 +78,10 @@ class EventConfigTest extends ModelTest
->value
->format('Y-m-d H:i')
);
+ $this->assertEquals(
+ null,
+ ($this->getEventConfig())->getValueAttribute(null)
+ );
}
/**