Use php 8.0 for nextcloud 22
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Michel Roux 2023-06-22 13:54:41 +02:00
parent aed2f2db38
commit cb8cf250a5
5 changed files with 6 additions and 12 deletions

View File

@ -18,7 +18,7 @@
},
"config": {
"platform": {
"php": "7.4"
"php": "8.0"
}
}
}

4
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5c7be477b217d6074abc6c2f8d2c2256",
"content-hash": "7b806afecf0b4bd9cf2aed44f533eaf4",
"packages": [],
"packages-dev": [
{
@ -389,7 +389,7 @@
"platform": [],
"platform-dev": [],
"platform-overrides": {
"php": "7.4"
"php": "8.0"
},
"plugin-api-version": "2.3.0"
}

View File

@ -167,10 +167,7 @@ class PageController extends Controller {
];
}
/**
* @param mixed $value
*/
private function toJson($value): string {
private function toJson(array $value): string {
return htmlspecialchars(json_encode($value), ENT_QUOTES, 'UTF-8');
}
}

View File

@ -24,7 +24,7 @@ abstract class ReaderEntity extends Entity {
*
* @return string|array
*/
public function conditional_json_decode(string $el) {
public function conditional_json_decode(string $el): mixed {
/** @var array $result */
$result = json_decode($el);
if (json_last_error() === JSON_ERROR_NONE) {

View File

@ -79,10 +79,7 @@ class Hooks {
$queryBuilder->executeStatement();
}
/**
* @param mixed $string
*/
private static function isJson($string): bool {
private static function isJson(mixed $string): bool {
return is_string($string) && is_array(json_decode($string, true)) && json_last_error() == JSON_ERROR_NONE;
}
}