[arch-commits] Commit in nextcloud/trunk (PKGBUILD nextcloud-23.0.0-php8.1.patch)

David Runge dvzrv at gemini.archlinux.org
Sat Jan 22 09:31:11 UTC 2022


    Date: Saturday, January 22, 2022 @ 09:31:10
  Author: dvzrv
Revision: 1113417

upgpkg: nextcloud 23.0.0-3: Rebuild to extend patch for php 8.1.

It appears backporting the changes applied from the previous upstream patch are
not sufficient, so also backport:
https://github.com/nextcloud/server/commit/113756db30fcbffe9e90b54c29e78dee0676109f

Fixes https://bugs.archlinux.org/task/73452

Modified:
  nextcloud/trunk/PKGBUILD
  nextcloud/trunk/nextcloud-23.0.0-php8.1.patch

-------------------------------+
 PKGBUILD                      |    6 
 nextcloud-23.0.0-php8.1.patch |  681 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 684 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-01-22 08:55:47 UTC (rev 1113416)
+++ PKGBUILD	2022-01-22 09:31:10 UTC (rev 1113417)
@@ -4,7 +4,7 @@
 pkgname=nextcloud
 # NOTE: do not package x.0.0 versions as they are considered beta
 pkgver=23.0.0
-pkgrel=2
+pkgrel=3
 pkgdesc="A cloud server to store your files centrally on a hardware controlled by you"
 arch=(any)
 url="https://nextcloud.com"
@@ -65,7 +65,7 @@
             '8bc7e76ba986cadf8d3bf35d6fbd8e7e236a61d1372e023c07e60427bacce925737c996d9fbaaeb51ed1066c1d0c8d83a86d7d640ed991b531744ed06629a670'
             'c585af280c2503a5a969fffd53d192a045a1dedd6d3a32901dfa0e226f9ddb4b5d1b1760553e962b061172c0077fcc57b095d8b7c70cafaa8ca84dbfce2eaa24'
             'eb69785a5b0df0e2a11f53f9c2e2dbf75681d7c698e88cbcc5ceed713a558d528511cc576813cc083cbaa28a2c83d543a39436ad4805670348ef22634305b1c8'
-            '00ce00f0bd5e424ee8bbaef72e7bf0a15f4987c059385abb3788d7605e2e9802176c5083a00b7e211be44c74eb83fe9b9bc1069256e0328f883a4abc01705a08')
+            '13062af253ceaafa4a65cdbd808318c643acc654f60454b31674e4f03bf49d1b20c5d0b3907f1d520871819eccb141968470defb7e48c1c7fba450af12361b9b')
 b2sums=('2dc00a1b522b51baa368a19628e354a674af1428e062595ccf75cb8541f497c1b2f8ed4f301cc0b5136382526e0e0c6ea1405f2d08a748b8fa2caf95d70c3d89'
         'SKIP'
         '7d40d120c28291f1a7537f3e1b5049fa83c9c0af949371345ea9ccdf3de4a0f3a3a06edbc52d9254dba483e4d11acf562cf679b9e379c5dfc2f61dfbfc2e4cef'
@@ -77,7 +77,7 @@
         '937ae5b89d968d784c7b68e1ca81e7aec11e295b95244fc4bcfec55b3d5f37ef70d5f593086eeb14101c8940a241565730cb6edcdf88165094c4ad27a89bd980'
         '9857f3dd219b624869255e0d6c262b60de813b87ac4fd3fccad0a330392f55709e8c2d4b9dfb5ad19df7cc0fc13cc83cead06c9a1d893ee4e4972c4937df0c2b'
         'e6214351ca16bfe97683e838e727d6b5eaa62194878272204034c62aac4a632c9b33cd31aa0570c2eb936d7e9e7ff60190ac05a3a8cc2e27eda423a7d89b6d39'
-        '509be5240a86010f1143c285f0c4796d6fdc3be0239b0345aeac7f295cb723e095b91a24302558b611d0d7146654e652d3caf1e479260941a7cc84bfc4207de3')
+        'd29c475db8a8fd083bf3981914a298d105484ee71e3dcbc9c726ea675b6f2dc56cf135850c22ac5231becdf1bcc6994ff645b179f7d14e0ace692e460ba2052b')
 validpgpkeys=('28806A878AE423A28372792ED75899B9A724937A') # Nextcloud Security <security at nextcloud.com>
 
 prepare() {

Modified: nextcloud-23.0.0-php8.1.patch
===================================================================
--- nextcloud-23.0.0-php8.1.patch	2022-01-22 08:55:47 UTC (rev 1113416)
+++ nextcloud-23.0.0-php8.1.patch	2022-01-22 09:31:10 UTC (rev 1113417)
@@ -1,3 +1,684 @@
+From 113756db30fcbffe9e90b54c29e78dee0676109f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet at nextcloud.com>
+Date: Tue, 19 Oct 2021 17:11:53 +0200
+Subject: [PATCH] Fix ArrayAccess and JsonSerializable return types
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+First round of modifications for PHP 8.1
+
+Signed-off-by: Côme Chilliet <come.chilliet at nextcloud.com>
+---
+ apps/files_external/lib/Lib/Auth/AuthMechanism.php |  4 +---
+ apps/files_external/lib/Lib/Backend/Backend.php    |  4 +---
+ .../files_external/lib/Lib/DefinitionParameter.php |  4 +---
+ apps/files_external/lib/Lib/StorageConfig.php      |  4 +---
+ apps/theming/lib/Service/JSDataService.php         |  2 +-
+ apps/user_status/lib/Service/JSDataService.php     |  2 +-
+ core/Command/Broadcast/Test.php                    |  2 +-
+ lib/private/Accounts/Account.php                   |  3 ++-
+ lib/private/Accounts/AccountProperty.php           |  2 +-
+ lib/private/Accounts/AccountPropertyCollection.php |  2 +-
+ lib/private/AppFramework/Http/Request.php          |  5 +++--
+ .../AppFramework/Utility/SimpleContainer.php       |  8 +++++---
+ lib/private/Authentication/Token/DefaultToken.php  |  2 +-
+ .../Authentication/Token/PublicKeyToken.php        |  2 +-
+ lib/private/Cache/CappedMemoryCache.php            | 10 +++++++---
+ .../Contacts/ContactsMenu/Actions/LinkAction.php   |  5 +----
+ .../EventDispatcher/GenericEventWrapper.php        | 14 +++++++++-----
+ lib/private/Files/Cache/CacheEntry.php             | 10 +++++++---
+ lib/private/Files/FileInfo.php                     | 10 +++++++---
+ lib/private/FullTextSearch/Model/IndexDocument.php |  4 +---
+ .../Model/SearchRequestSimpleQuery.php             |  3 +--
+ lib/private/L10N/L10NString.php                    |  6 +-----
+ lib/private/Memcache/Cache.php                     | 10 +++++++---
+ lib/private/Session/CryptoSessionData.php          |  5 +++--
+ lib/private/Session/Session.php                    |  5 +++--
+ .../AppFramework/Services/InitialStateProvider.php |  2 ++
+ lib/public/Dashboard/Model/WidgetSetting.php       |  4 +---
+ lib/public/Dashboard/Model/WidgetSetup.php         |  4 +---
+ lib/public/Dashboard/Model/WidgetTemplate.php      |  4 +---
+ lib/public/DirectEditing/ATemplate.php             |  3 +--
+ lib/public/EventDispatcher/GenericEvent.php        |  2 ++
+ lib/public/Files/Template/Template.php             |  2 +-
+ lib/public/Files/Template/TemplateFileCreator.php  |  2 +-
+ tests/lib/InitialStateServiceTest.php              |  2 +-
+ 34 files changed, 79 insertions(+), 74 deletions(-)
+
+diff --git a/apps/files_external/lib/Lib/Auth/AuthMechanism.php b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
+index f676957794d8..210dd705723e 100644
+--- a/apps/files_external/lib/Lib/Auth/AuthMechanism.php
++++ b/apps/files_external/lib/Lib/Auth/AuthMechanism.php
+@@ -90,10 +90,8 @@ public function setScheme($scheme) {
+ 
+ 	/**
+ 	 * Serialize into JSON for client-side JS
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		$data = $this->jsonSerializeDefinition();
+ 		$data += $this->jsonSerializeIdentifier();
+ 
+diff --git a/apps/files_external/lib/Lib/Backend/Backend.php b/apps/files_external/lib/Lib/Backend/Backend.php
+index a6e63eb30d19..021d208aed33 100644
+--- a/apps/files_external/lib/Lib/Backend/Backend.php
++++ b/apps/files_external/lib/Lib/Backend/Backend.php
+@@ -137,10 +137,8 @@ public function setLegacyAuthMechanismCallback(callable $callback) {
+ 
+ 	/**
+ 	 * Serialize into JSON for client-side JS
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		$data = $this->jsonSerializeDefinition();
+ 		$data += $this->jsonSerializeIdentifier();
+ 
+diff --git a/apps/files_external/lib/Lib/DefinitionParameter.php b/apps/files_external/lib/Lib/DefinitionParameter.php
+index fbfbbfd4686a..6b081d5a089f 100644
+--- a/apps/files_external/lib/Lib/DefinitionParameter.php
++++ b/apps/files_external/lib/Lib/DefinitionParameter.php
+@@ -167,10 +167,8 @@ public function setTooltip(string $tooltip) {
+ 
+ 	/**
+ 	 * Serialize into JSON for client-side JS
+-	 *
+-	 * @return string
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'value' => $this->getText(),
+ 			'flags' => $this->getFlags(),
+diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php
+index 97b72005018d..26ba483b00ef 100644
+--- a/apps/files_external/lib/Lib/StorageConfig.php
++++ b/apps/files_external/lib/Lib/StorageConfig.php
+@@ -396,10 +396,8 @@ public function setType($type) {
+ 
+ 	/**
+ 	 * Serialize config to JSON
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		$result = [];
+ 		if (!is_null($this->id)) {
+ 			$result['id'] = $this->id;
+diff --git a/apps/theming/lib/Service/JSDataService.php b/apps/theming/lib/Service/JSDataService.php
+index a6e5d6f8e365..1c4d138a7646 100644
+--- a/apps/theming/lib/Service/JSDataService.php
++++ b/apps/theming/lib/Service/JSDataService.php
+@@ -50,7 +50,7 @@ public function __construct(
+ 		$this->appConfig = $appConfig;
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'name' => $this->themingDefaults->getName(),
+ 			'url' => $this->themingDefaults->getBaseUrl(),
+diff --git a/apps/user_status/lib/Service/JSDataService.php b/apps/user_status/lib/Service/JSDataService.php
+index 6d83591ab2f4..c08643ec64fb 100644
+--- a/apps/user_status/lib/Service/JSDataService.php
++++ b/apps/user_status/lib/Service/JSDataService.php
+@@ -49,7 +49,7 @@ public function __construct(IUserSession $userSession,
+ 		$this->statusService = $statusService;
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		$user = $this->userSession->getUser();
+ 
+ 		if ($user === null) {
+diff --git a/core/Command/Broadcast/Test.php b/core/Command/Broadcast/Test.php
+index 91050725e176..86cd30e4b4c6 100644
+--- a/core/Command/Broadcast/Test.php
++++ b/core/Command/Broadcast/Test.php
+@@ -87,7 +87,7 @@ public function getUids(): array {
+ 				];
+ 			}
+ 
+-			public function jsonSerialize() {
++			public function jsonSerialize(): array {
+ 				return [
+ 					'description' => 'this is a test event',
+ 				];
+diff --git a/lib/private/Accounts/Account.php b/lib/private/Accounts/Account.php
+index 1e4189f2b35c..540d15cd4b9e 100644
+--- a/lib/private/Accounts/Account.php
++++ b/lib/private/Accounts/Account.php
+@@ -104,7 +104,8 @@ public function getFilteredProperties(string $scope = null, string $verified = n
+ 		return $result;
+ 	}
+ 
+-	public function jsonSerialize() {
++	/** @return IAccountPropertyCollection[]|IAccountProperty[] */
++	public function jsonSerialize(): array {
+ 		return $this->properties;
+ 	}
+ 
+diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php
+index 0e6356e9e92e..4b7f2b0c04c2 100644
+--- a/lib/private/Accounts/AccountProperty.php
++++ b/lib/private/Accounts/AccountProperty.php
+@@ -54,7 +54,7 @@ public function __construct(string $name, string $value, string $scope, string $
+ 		$this->verificationData = $verificationData;
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'name' => $this->getName(),
+ 			'value' => $this->getValue(),
+diff --git a/lib/private/Accounts/AccountPropertyCollection.php b/lib/private/Accounts/AccountPropertyCollection.php
+index 3aed76d8746a..091c5734218b 100644
+--- a/lib/private/Accounts/AccountPropertyCollection.php
++++ b/lib/private/Accounts/AccountPropertyCollection.php
+@@ -102,7 +102,7 @@ public function removePropertyByValue(string $value): IAccountPropertyCollection
+ 		return $this;
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [$this->collectionName => $this->properties];
+ 	}
+ 
+diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
+index a95fd208155c..c67500bcaa4e 100644
+--- a/lib/private/AppFramework/Http/Request.php
++++ b/lib/private/AppFramework/Http/Request.php
+@@ -199,6 +199,7 @@ public function offsetExists($offset): bool {
+ 	 * @param string $offset
+ 	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		return isset($this->items['parameters'][$offset])
+ 			? $this->items['parameters'][$offset]
+@@ -210,7 +211,7 @@ public function offsetGet($offset) {
+ 	 * @param string $offset
+ 	 * @param mixed $value
+ 	 */
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		throw new \RuntimeException('You cannot change the contents of the request object');
+ 	}
+ 
+@@ -218,7 +219,7 @@ public function offsetSet($offset, $value) {
+ 	 * @see offsetExists
+ 	 * @param string $offset
+ 	 */
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		throw new \RuntimeException('You cannot change the contents of the request object');
+ 	}
+ 
+diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php
+index c38dbadf0a97..598c66b6aba7 100644
+--- a/lib/private/AppFramework/Utility/SimpleContainer.php
++++ b/lib/private/AppFramework/Utility/SimpleContainer.php
+@@ -197,13 +197,15 @@ protected function sanitizeName($name) {
+ 	/**
+ 	 * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::has
+ 	 */
+-	public function offsetExists($id) {
++	public function offsetExists($id): bool {
+ 		return $this->container->offsetExists($id);
+ 	}
+ 
+ 	/**
+ 	 * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
++	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($id) {
+ 		return $this->container->offsetGet($id);
+ 	}
+@@ -211,14 +213,14 @@ public function offsetGet($id) {
+ 	/**
+ 	 * @deprecated 20.0.0 use \OCP\IContainer::registerService
+ 	 */
+-	public function offsetSet($id, $service) {
++	public function offsetSet($id, $service): void {
+ 		$this->container->offsetSet($id, $service);
+ 	}
+ 
+ 	/**
+ 	 * @deprecated 20.0.0
+ 	 */
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		$this->container->offsetUnset($offset);
+ 	}
+ }
+diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php
+index 5a008586a901..b649fdbb6aff 100644
+--- a/lib/private/Authentication/Token/DefaultToken.php
++++ b/lib/private/Authentication/Token/DefaultToken.php
+@@ -121,7 +121,7 @@ public function getPassword() {
+ 		return parent::getPassword();
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'id' => $this->id,
+ 			'name' => $this->name,
+diff --git a/lib/private/Authentication/Token/PublicKeyToken.php b/lib/private/Authentication/Token/PublicKeyToken.php
+index 3351c767ce3b..d060fe141032 100644
+--- a/lib/private/Authentication/Token/PublicKeyToken.php
++++ b/lib/private/Authentication/Token/PublicKeyToken.php
+@@ -138,7 +138,7 @@ public function getPassword() {
+ 		return parent::getPassword();
+ 	}
+ 
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'id' => $this->id,
+ 			'name' => $this->name,
+diff --git a/lib/private/Cache/CappedMemoryCache.php b/lib/private/Cache/CappedMemoryCache.php
+index 408c3935ffb9..584a53f0ff28 100644
+--- a/lib/private/Cache/CappedMemoryCache.php
++++ b/lib/private/Cache/CappedMemoryCache.php
+@@ -63,19 +63,23 @@ public function clear($prefix = '') {
+ 		return true;
+ 	}
+ 
+-	public function offsetExists($offset) {
++	public function offsetExists($offset): bool {
+ 		return $this->hasKey($offset);
+ 	}
+ 
++	/**
++	 * @return mixed
++	 */
++	#[\ReturnTypeWillChange]
+ 	public function &offsetGet($offset) {
+ 		return $this->cache[$offset];
+ 	}
+ 
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->set($offset, $value);
+ 	}
+ 
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		$this->remove($offset);
+ 	}
+ 
+diff --git a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
+index 5acafed2fdaf..3f917854aac8 100644
+--- a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
++++ b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php
+@@ -106,10 +106,7 @@ public function getAppId(): string {
+ 		return $this->appId;
+ 	}
+ 
+-	/**
+-	 * @return array
+-	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'title' => $this->name,
+ 			'icon' => $this->icon,
+diff --git a/lib/private/EventDispatcher/GenericEventWrapper.php b/lib/private/EventDispatcher/GenericEventWrapper.php
+index 55e23d2ff7fa..3574bc8bb835 100644
+--- a/lib/private/EventDispatcher/GenericEventWrapper.php
++++ b/lib/private/EventDispatcher/GenericEventWrapper.php
+@@ -100,19 +100,23 @@ public function hasArgument($key) {
+ 		return $this->event->hasArgument($key);
+ 	}
+ 
++	/**
++	 * @return mixed
++	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($key) {
+ 		return $this->event->offsetGet($key);
+ 	}
+ 
+-	public function offsetSet($key, $value) {
+-		return $this->event->offsetSet($key, $value);
++	public function offsetSet($key, $value): void {
++		$this->event->offsetSet($key, $value);
+ 	}
+ 
+-	public function offsetUnset($key) {
+-		return $this->event->offsetUnset($key);
++	public function offsetUnset($key): void {
++		$this->event->offsetUnset($key);
+ 	}
+ 
+-	public function offsetExists($key) {
++	public function offsetExists($key): bool {
+ 		return $this->event->offsetExists($key);
+ 	}
+ 
+diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php
+index 156f075c2d06..12f0273fb6e7 100644
+--- a/lib/private/Files/Cache/CacheEntry.php
++++ b/lib/private/Files/Cache/CacheEntry.php
+@@ -37,18 +37,22 @@ public function __construct(array $data) {
+ 		$this->data = $data;
+ 	}
+ 
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->data[$offset] = $value;
+ 	}
+ 
+-	public function offsetExists($offset) {
++	public function offsetExists($offset): bool {
+ 		return isset($this->data[$offset]);
+ 	}
+ 
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		unset($this->data[$offset]);
+ 	}
+ 
++	/**
++	 * @return mixed
++	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		if (isset($this->data[$offset])) {
+ 			return $this->data[$offset];
+diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
+index 8a8de6e4c19b..2f361fc051db 100644
+--- a/lib/private/Files/FileInfo.php
++++ b/lib/private/Files/FileInfo.php
+@@ -104,18 +104,22 @@ public function __construct($path, $storage, $internalPath, $data, $mount, $owne
+ 		$this->rawSize = $this->data['size'] ?? 0;
+ 	}
+ 
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->data[$offset] = $value;
+ 	}
+ 
+-	public function offsetExists($offset) {
++	public function offsetExists($offset): bool {
+ 		return isset($this->data[$offset]);
+ 	}
+ 
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		unset($this->data[$offset]);
+ 	}
+ 
++	/**
++	 * @return mixed
++	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		if ($offset === 'type') {
+ 			return $this->getType();
+diff --git a/lib/private/FullTextSearch/Model/IndexDocument.php b/lib/private/FullTextSearch/Model/IndexDocument.php
+index a1648ab6e2ab..3078f12c4653 100644
+--- a/lib/private/FullTextSearch/Model/IndexDocument.php
++++ b/lib/private/FullTextSearch/Model/IndexDocument.php
+@@ -963,10 +963,8 @@ public function __destruct() {
+ 
+ 	/**
+ 	 * @since 15.0.0
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'id' => $this->getId(),
+ 			'providerId' => $this->getProviderId(),
+diff --git a/lib/private/FullTextSearch/Model/SearchRequestSimpleQuery.php b/lib/private/FullTextSearch/Model/SearchRequestSimpleQuery.php
+index 9c9ac71efa95..d6bfe6d91023 100644
+--- a/lib/private/FullTextSearch/Model/SearchRequestSimpleQuery.php
++++ b/lib/private/FullTextSearch/Model/SearchRequestSimpleQuery.php
+@@ -168,10 +168,9 @@ public function addValueBool(bool $value): ISearchRequestSimpleQuery {
+ 
+ 
+ 	/**
+-	 * @return array|mixed
+ 	 * @since 17.0.0
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'type' => $this->getType(),
+ 			'field' => $this->getField(),
+diff --git a/lib/private/L10N/L10NString.php b/lib/private/L10N/L10NString.php
+index 33ccc4b14096..de4bc38d7442 100644
+--- a/lib/private/L10N/L10NString.php
++++ b/lib/private/L10N/L10NString.php
+@@ -82,11 +82,7 @@ public function __toString(): string {
+ 		return vsprintf($text, $this->parameters);
+ 	}
+ 
+-
+-	/**
+-	 * @return string
+-	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): string {
+ 		return $this->__toString();
+ 	}
+ }
+diff --git a/lib/private/Memcache/Cache.php b/lib/private/Memcache/Cache.php
+index 95213c168497..1d54a705098e 100644
+--- a/lib/private/Memcache/Cache.php
++++ b/lib/private/Memcache/Cache.php
+@@ -78,19 +78,23 @@ abstract public function clear($prefix = '');
+ 
+ 	//implement the ArrayAccess interface
+ 
+-	public function offsetExists($offset) {
++	public function offsetExists($offset): bool {
+ 		return $this->hasKey($offset);
+ 	}
+ 
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->set($offset, $value);
+ 	}
+ 
++	/**
++	 * @return mixed
++	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		return $this->get($offset);
+ 	}
+ 
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		$this->remove($offset);
+ 	}
+ }
+diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php
+index 94ad8f90dcfd..2e3bd46da5b4 100644
+--- a/lib/private/Session/CryptoSessionData.php
++++ b/lib/private/Session/CryptoSessionData.php
+@@ -195,6 +195,7 @@ public function offsetExists($offset): bool {
+ 	 * @param mixed $offset
+ 	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		return $this->get($offset);
+ 	}
+@@ -203,14 +204,14 @@ public function offsetGet($offset) {
+ 	 * @param mixed $offset
+ 	 * @param mixed $value
+ 	 */
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->set($offset, $value);
+ 	}
+ 
+ 	/**
+ 	 * @param mixed $offset
+ 	 */
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		$this->remove($offset);
+ 	}
+ }
+diff --git a/lib/private/Session/Session.php b/lib/private/Session/Session.php
+index b9497983fbb0..affba322bec7 100644
+--- a/lib/private/Session/Session.php
++++ b/lib/private/Session/Session.php
+@@ -55,6 +55,7 @@ public function offsetExists($offset): bool {
+ 	 * @param mixed $offset
+ 	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		return $this->get($offset);
+ 	}
+@@ -63,14 +64,14 @@ public function offsetGet($offset) {
+ 	 * @param mixed $offset
+ 	 * @param mixed $value
+ 	 */
+-	public function offsetSet($offset, $value) {
++	public function offsetSet($offset, $value): void {
+ 		$this->set($offset, $value);
+ 	}
+ 
+ 	/**
+ 	 * @param mixed $offset
+ 	 */
+-	public function offsetUnset($offset) {
++	public function offsetUnset($offset): void {
+ 		$this->remove($offset);
+ 	}
+ 
+diff --git a/lib/public/AppFramework/Services/InitialStateProvider.php b/lib/public/AppFramework/Services/InitialStateProvider.php
+index c317fad3f5de..dbc486537924 100644
+--- a/lib/public/AppFramework/Services/InitialStateProvider.php
++++ b/lib/public/AppFramework/Services/InitialStateProvider.php
+@@ -42,7 +42,9 @@ abstract public function getData();
+ 
+ 	/**
+ 	 * @since 21.0.0
++	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	final public function jsonSerialize() {
+ 		return $this->getData();
+ 	}
+diff --git a/lib/public/Dashboard/Model/WidgetSetting.php b/lib/public/Dashboard/Model/WidgetSetting.php
+index c456c63f4f58..fce59a4350b6 100644
+--- a/lib/public/Dashboard/Model/WidgetSetting.php
++++ b/lib/public/Dashboard/Model/WidgetSetting.php
+@@ -230,10 +230,8 @@ public function getDefault(): string {
+ 	/**
+ 	 * @since 15.0.0
+ 	 * @deprecated 20.0.0
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'name' => $this->getName(),
+ 			'title' => $this->getTitle(),
+diff --git a/lib/public/Dashboard/Model/WidgetSetup.php b/lib/public/Dashboard/Model/WidgetSetup.php
+index 1cc8d9ff561b..f3e09dcc71b1 100644
+--- a/lib/public/Dashboard/Model/WidgetSetup.php
++++ b/lib/public/Dashboard/Model/WidgetSetup.php
+@@ -261,10 +261,8 @@ public function setDefaultSettings(array $settings): WidgetSetup {
+ 	/**
+ 	 * @since 15.0.0
+ 	 * @deprecated 20.0.0
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'size' => $this->getSizes(),
+ 			'menu' => $this->getMenuEntries(),
+diff --git a/lib/public/Dashboard/Model/WidgetTemplate.php b/lib/public/Dashboard/Model/WidgetTemplate.php
+index e6f9742fed7a..3521960c303c 100644
+--- a/lib/public/Dashboard/Model/WidgetTemplate.php
++++ b/lib/public/Dashboard/Model/WidgetTemplate.php
+@@ -312,10 +312,8 @@ public function getSetting(string $key): WidgetSetting {
+ 	/**
+ 	 * @since 15.0.0
+ 	 * @deprecated 20.0.0
+-	 *
+-	 * @return array
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'icon' => $this->getIcon(),
+ 			'css' => $this->getCss(),
+diff --git a/lib/public/DirectEditing/ATemplate.php b/lib/public/DirectEditing/ATemplate.php
+index c38fc898dab4..53aff0d40ffe 100644
+--- a/lib/public/DirectEditing/ATemplate.php
++++ b/lib/public/DirectEditing/ATemplate.php
+@@ -57,9 +57,8 @@ abstract public function getPreview(): string;
+ 
+ 	/**
+ 	 * @since 18.0.0
+-	 * @return array|mixed
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'id' => $this->getId(),
+ 			'title' => $this->getTitle(),
+diff --git a/lib/public/EventDispatcher/GenericEvent.php b/lib/public/EventDispatcher/GenericEvent.php
+index e78ae1827a16..1ba1cc6da14f 100644
+--- a/lib/public/EventDispatcher/GenericEvent.php
++++ b/lib/public/EventDispatcher/GenericEvent.php
+@@ -156,7 +156,9 @@ public function offsetExists($offset): bool {
+ 	 * @link https://php.net/manual/en/arrayaccess.offsetget.php
+ 	 * @since 18.0.0
+ 	 * @deprecated 22.0.0
++	 * @return mixed
+ 	 */
++	#[\ReturnTypeWillChange]
+ 	public function offsetGet($offset) {
+ 		return $this->arguments[$offset];
+ 	}
+diff --git a/lib/public/Files/Template/Template.php b/lib/public/Files/Template/Template.php
+index 50d8b406be9c..d71ef3b3655d 100644
+--- a/lib/public/Files/Template/Template.php
++++ b/lib/public/Files/Template/Template.php
+@@ -69,7 +69,7 @@ public function setHasPreview(bool $hasPreview): void {
+ 	/**
+ 	 * @since 21.0.0
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'templateType' => $this->templateType,
+ 			'templateId' => $this->templateId,
+diff --git a/lib/public/Files/Template/TemplateFileCreator.php b/lib/public/Files/Template/TemplateFileCreator.php
+index 7be45e68ef9f..26edf585869d 100644
+--- a/lib/public/Files/Template/TemplateFileCreator.php
++++ b/lib/public/Files/Template/TemplateFileCreator.php
+@@ -106,7 +106,7 @@ public function getOrder(): int {
+ 	/**
+ 	 * @since 21.0.0
+ 	 */
+-	public function jsonSerialize() {
++	public function jsonSerialize(): array {
+ 		return [
+ 			'app' => $this->appId,
+ 			'label' => $this->actionName,
+
 From 260be93a14af6eccb6240dfb3692073775da259e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet at nextcloud.com>
 Date: Tue, 19 Oct 2021 17:08:57 +0200



More information about the arch-commits mailing list