зеркало из https://github.com/nextcloud/cookbook.git
Fix PHP 7.4 code syntax issues
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Родитель
4a64856159
Коммит
230c84bc3f
|
@ -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, '');
|
||||
|
|
Загрузка…
Ссылка в новой задаче