Fix PHP 7.4 code syntax issues

Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Christian Wolf 2023-12-05 15:35:45 +01:00
Родитель 4a64856159
Коммит 230c84bc3f
3 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -26,7 +26,7 @@ abstract class AbstractJSONFilter {
/**
* @param string|int|float|array $value
*/
protected function setJSONValue(array &$json, string $key, string|int|float|array $value): bool {
protected function setJSONValue(array &$json, string $key, $value): bool {
if (!array_key_exists($key, $json)) {
$json[$key] = $value;
return true;

Просмотреть файл

@ -12,7 +12,7 @@ class RecipeStubFilter {
public function __construct(
RecipeIdTypeFilter $recipeIdTypeFilter,
RecipeIdCopyFilter $recipeIdCopyFilter,
RecipeIdCopyFilter $recipeIdCopyFilter
) {
$this->filters = [
$recipeIdCopyFilter,

Просмотреть файл

@ -45,7 +45,7 @@ class TimestampHelper {
// For now, we only support the ISO8601 format because it is required in the schema.org standard
try {
return $this->parseIsoFormat($timestamp);
} catch (InvalidTimestampException) {
} catch (InvalidTimestampException $ex) {
// We do nothing here. Check the next format
}
@ -65,15 +65,15 @@ class TimestampHelper {
private function parseIsoFormat(string $timestamp): string {
try {
return $this->parseIsoCalendarDateFormat($timestamp, '-');
} catch (InvalidTimestampException) { // Check next format
} catch (InvalidTimestampException $ex) { // Check next format
}
try {
return $this->parseIsoCalendarDateFormat($timestamp, '');
} catch (InvalidTimestampException) { // Check next format
} catch (InvalidTimestampException $ex) { // Check next format
}
try {
return $this->parseIsoWeekDateFormat($timestamp, '-');
} catch (InvalidTimestampException) { // Check next format
} catch (InvalidTimestampException $ex) { // Check next format
}
return $this->parseIsoWeekDateFormat($timestamp, '');