зеркало из 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
|
* @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)) {
|
if (!array_key_exists($key, $json)) {
|
||||||
$json[$key] = $value;
|
$json[$key] = $value;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -12,7 +12,7 @@ class RecipeStubFilter {
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
RecipeIdTypeFilter $recipeIdTypeFilter,
|
RecipeIdTypeFilter $recipeIdTypeFilter,
|
||||||
RecipeIdCopyFilter $recipeIdCopyFilter,
|
RecipeIdCopyFilter $recipeIdCopyFilter
|
||||||
) {
|
) {
|
||||||
$this->filters = [
|
$this->filters = [
|
||||||
$recipeIdCopyFilter,
|
$recipeIdCopyFilter,
|
||||||
|
|
|
@ -45,7 +45,7 @@ class TimestampHelper {
|
||||||
// For now, we only support the ISO8601 format because it is required in the schema.org standard
|
// For now, we only support the ISO8601 format because it is required in the schema.org standard
|
||||||
try {
|
try {
|
||||||
return $this->parseIsoFormat($timestamp);
|
return $this->parseIsoFormat($timestamp);
|
||||||
} catch (InvalidTimestampException) {
|
} catch (InvalidTimestampException $ex) {
|
||||||
// We do nothing here. Check the next format
|
// We do nothing here. Check the next format
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,15 +65,15 @@ class TimestampHelper {
|
||||||
private function parseIsoFormat(string $timestamp): string {
|
private function parseIsoFormat(string $timestamp): string {
|
||||||
try {
|
try {
|
||||||
return $this->parseIsoCalendarDateFormat($timestamp, '-');
|
return $this->parseIsoCalendarDateFormat($timestamp, '-');
|
||||||
} catch (InvalidTimestampException) { // Check next format
|
} catch (InvalidTimestampException $ex) { // Check next format
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return $this->parseIsoCalendarDateFormat($timestamp, '');
|
return $this->parseIsoCalendarDateFormat($timestamp, '');
|
||||||
} catch (InvalidTimestampException) { // Check next format
|
} catch (InvalidTimestampException $ex) { // Check next format
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
return $this->parseIsoWeekDateFormat($timestamp, '-');
|
return $this->parseIsoWeekDateFormat($timestamp, '-');
|
||||||
} catch (InvalidTimestampException) { // Check next format
|
} catch (InvalidTimestampException $ex) { // Check next format
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->parseIsoWeekDateFormat($timestamp, '');
|
return $this->parseIsoWeekDateFormat($timestamp, '');
|
||||||
|
|
Загрузка…
Ссылка в новой задаче