aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/AppFramework')
-rw-r--r--lib/public/AppFramework/Bootstrap/IRegistrationContext.php24
-rw-r--r--lib/public/AppFramework/Db/Entity.php2
-rw-r--r--lib/public/AppFramework/Http/Attribute/CORS.php4
-rw-r--r--lib/public/AppFramework/Http/DataDisplayResponse.php4
-rw-r--r--lib/public/AppFramework/Http/DataDownloadResponse.php4
-rw-r--r--lib/public/AppFramework/Http/DataResponse.php4
-rw-r--r--lib/public/AppFramework/Http/DownloadResponse.php4
-rw-r--r--lib/public/AppFramework/Http/FileDisplayResponse.php4
-rw-r--r--lib/public/AppFramework/Http/JSONResponse.php6
-rw-r--r--lib/public/AppFramework/Http/NotFoundResponse.php4
-rw-r--r--lib/public/AppFramework/Http/RedirectResponse.php4
-rw-r--r--lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php4
-rw-r--r--lib/public/AppFramework/Http/Response.php2
-rw-r--r--lib/public/AppFramework/Http/StandaloneTemplateResponse.php6
-rw-r--r--lib/public/AppFramework/Http/StreamResponse.php4
-rw-r--r--lib/public/AppFramework/Http/Template/PublicTemplateResponse.php4
-rw-r--r--lib/public/AppFramework/Http/TemplateResponse.php4
-rw-r--r--lib/public/AppFramework/Http/TextPlainResponse.php4
-rw-r--r--lib/public/AppFramework/Http/TooManyRequestsResponse.php4
-rw-r--r--lib/public/AppFramework/Http/ZipResponse.php4
-rw-r--r--lib/public/AppFramework/Services/IInitialState.php2
21 files changed, 65 insertions, 37 deletions
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
index b9e5413e5c2..011d1520414 100644
--- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
+++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
@@ -415,6 +415,19 @@ interface IRegistrationContext {
public function registerTaskProcessingTaskType(string $taskProcessingTaskTypeClass): void;
/**
+ * Register an implementation of \OCP\Files\Conversion\IConversionProvider
+ * that will handle the conversion of files from one MIME type to another
+ *
+ * @param string $class
+ * @psalm-param class-string<\OCP\Files\Conversion\IConversionProvider> $class
+ *
+ * @return void
+ *
+ * @since 31.0.0
+ */
+ public function registerFileConversionProvider(string $class): void;
+
+ /**
* Register a mail provider
*
* @param string $class
@@ -423,4 +436,15 @@ interface IRegistrationContext {
*/
public function registerMailProvider(string $class): void;
+
+ /**
+ * Register an implementation of \OCP\Config\Lexicon\IConfigLexicon that
+ * will handle the config lexicon
+ *
+ * @param string $configLexiconClass
+ *
+ * @psalm-param class-string<\NCU\Config\Lexicon\IConfigLexicon> $configLexiconClass
+ * @since 31.0.0
+ */
+ public function registerConfigLexicon(string $configLexiconClass): void;
}
diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php
index d90d3ed4837..a44a9a8bced 100644
--- a/lib/public/AppFramework/Db/Entity.php
+++ b/lib/public/AppFramework/Db/Entity.php
@@ -215,7 +215,7 @@ abstract class Entity {
* @return string the property name
* @since 7.0.0
*/
- public function columnToProperty(string $columnName): string {
+ public function columnToProperty(string $columnName) {
$parts = explode('_', $columnName);
$property = '';
diff --git a/lib/public/AppFramework/Http/Attribute/CORS.php b/lib/public/AppFramework/Http/Attribute/CORS.php
index 2c3eac362cf..ff639635635 100644
--- a/lib/public/AppFramework/Http/Attribute/CORS.php
+++ b/lib/public/AppFramework/Http/Attribute/CORS.php
@@ -12,7 +12,9 @@ namespace OCP\AppFramework\Http\Attribute;
use Attribute;
/**
- * Attribute for controller methods that can also be accessed by not logged-in user
+ * Attribute for controller methods that can also be accessed by other websites.
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS for an explanation of the functionality and the security implications.
+ * See https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/rest_apis.html on how to implement it in your controller.
*
* @since 27.0.0
*/
diff --git a/lib/public/AppFramework/Http/DataDisplayResponse.php b/lib/public/AppFramework/Http/DataDisplayResponse.php
index 889c57a7901..e1ded910328 100644
--- a/lib/public/AppFramework/Http/DataDisplayResponse.php
+++ b/lib/public/AppFramework/Http/DataDisplayResponse.php
@@ -13,9 +13,9 @@ use OCP\AppFramework\Http;
* Class DataDisplayResponse
*
* @since 8.1.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class DataDisplayResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/DataDownloadResponse.php b/lib/public/AppFramework/Http/DataDownloadResponse.php
index 80100137c48..ee6bcf0d0c5 100644
--- a/lib/public/AppFramework/Http/DataDownloadResponse.php
+++ b/lib/public/AppFramework/Http/DataDownloadResponse.php
@@ -13,10 +13,10 @@ use OCP\AppFramework\Http;
* Class DataDownloadResponse
*
* @since 8.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template C of string
* @template H of array<string, mixed>
- * @template-extends DownloadResponse<int, string, array<string, mixed>>
+ * @template-extends DownloadResponse<Http::STATUS_*, string, array<string, mixed>>
*/
class DataDownloadResponse extends DownloadResponse {
/**
diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php
index 2ebb66f9e73..2b54ce848ef 100644
--- a/lib/public/AppFramework/Http/DataResponse.php
+++ b/lib/public/AppFramework/Http/DataResponse.php
@@ -14,10 +14,10 @@ use OCP\AppFramework\Http;
* for responders to transform
* @since 8.0.0
* @psalm-type DataResponseType = array|int|float|string|bool|object|null|\stdClass|\JsonSerializable
- * @template S of int
+ * @template S of Http::STATUS_*
* @template-covariant T of DataResponseType
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class DataResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/DownloadResponse.php b/lib/public/AppFramework/Http/DownloadResponse.php
index 058b3070297..190de022d36 100644
--- a/lib/public/AppFramework/Http/DownloadResponse.php
+++ b/lib/public/AppFramework/Http/DownloadResponse.php
@@ -12,10 +12,10 @@ use OCP\AppFramework\Http;
/**
* Prompts the user to download the a file
* @since 7.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template C of string
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class DownloadResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/FileDisplayResponse.php b/lib/public/AppFramework/Http/FileDisplayResponse.php
index 0cc51f7c59f..fda160eafc5 100644
--- a/lib/public/AppFramework/Http/FileDisplayResponse.php
+++ b/lib/public/AppFramework/Http/FileDisplayResponse.php
@@ -13,9 +13,9 @@ use OCP\Files\SimpleFS\ISimpleFile;
* Class FileDisplayResponse
*
* @since 11.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class FileDisplayResponse extends Response implements ICallbackResponse {
/** @var File|ISimpleFile */
diff --git a/lib/public/AppFramework/Http/JSONResponse.php b/lib/public/AppFramework/Http/JSONResponse.php
index afe36c4a8c3..efcf79d5e87 100644
--- a/lib/public/AppFramework/Http/JSONResponse.php
+++ b/lib/public/AppFramework/Http/JSONResponse.php
@@ -12,10 +12,10 @@ use OCP\AppFramework\Http;
/**
* A renderer for JSON calls
* @since 6.0.0
- * @template S of int
- * @template-covariant T of array|object|\stdClass|\JsonSerializable
+ * @template S of Http::STATUS_*
+ * @template-covariant T of null|string|int|float|bool|array|\stdClass|\JsonSerializable
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class JSONResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/NotFoundResponse.php b/lib/public/AppFramework/Http/NotFoundResponse.php
index 9ebefe69be1..137d1a26655 100644
--- a/lib/public/AppFramework/Http/NotFoundResponse.php
+++ b/lib/public/AppFramework/Http/NotFoundResponse.php
@@ -12,9 +12,9 @@ use OCP\AppFramework\Http;
/**
* A generic 404 response showing an 404 error page as well to the end-user
* @since 8.1.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends TemplateResponse<int, array<string, mixed>>
+ * @template-extends TemplateResponse<Http::STATUS_*, array<string, mixed>>
*/
class NotFoundResponse extends TemplateResponse {
/**
diff --git a/lib/public/AppFramework/Http/RedirectResponse.php b/lib/public/AppFramework/Http/RedirectResponse.php
index 41fc4d83856..74847205976 100644
--- a/lib/public/AppFramework/Http/RedirectResponse.php
+++ b/lib/public/AppFramework/Http/RedirectResponse.php
@@ -12,9 +12,9 @@ use OCP\AppFramework\Http;
/**
* Redirects to a different URL
* @since 7.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class RedirectResponse extends Response {
private $redirectURL;
diff --git a/lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php b/lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php
index 3e2fcf6f6c7..1681b39ce50 100644
--- a/lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php
+++ b/lib/public/AppFramework/Http/RedirectToDefaultAppResponse.php
@@ -16,9 +16,9 @@ use OCP\IURLGenerator;
*
* @since 16.0.0
* @deprecated 23.0.0 Use RedirectResponse() with IURLGenerator::linkToDefaultPageUrl() instead
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends RedirectResponse<int, array<string, mixed>>
+ * @template-extends RedirectResponse<Http::STATUS_*, array<string, mixed>>
*/
class RedirectToDefaultAppResponse extends RedirectResponse {
/**
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index d1860402359..6fc3d4b98ea 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface;
*
* It handles headers, HTTP status code, last modified and ETag.
* @since 6.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
*/
class Response {
diff --git a/lib/public/AppFramework/Http/StandaloneTemplateResponse.php b/lib/public/AppFramework/Http/StandaloneTemplateResponse.php
index f729bd772fb..244a6b80f9f 100644
--- a/lib/public/AppFramework/Http/StandaloneTemplateResponse.php
+++ b/lib/public/AppFramework/Http/StandaloneTemplateResponse.php
@@ -7,6 +7,8 @@ declare(strict_types=1);
*/
namespace OCP\AppFramework\Http;
+use OCP\AppFramework\Http;
+
/**
* A template response that does not emit the loadAdditionalScripts events.
*
@@ -14,9 +16,9 @@ namespace OCP\AppFramework\Http;
* full nextcloud UI. Like the 2FA page, or the grant page in the login flow.
*
* @since 16.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends TemplateResponse<int, array<string, mixed>>
+ * @template-extends TemplateResponse<Http::STATUS_*, array<string, mixed>>
*/
class StandaloneTemplateResponse extends TemplateResponse {
}
diff --git a/lib/public/AppFramework/Http/StreamResponse.php b/lib/public/AppFramework/Http/StreamResponse.php
index 1039e20e5c5..d0e6e3e148a 100644
--- a/lib/public/AppFramework/Http/StreamResponse.php
+++ b/lib/public/AppFramework/Http/StreamResponse.php
@@ -13,9 +13,9 @@ use OCP\AppFramework\Http;
* Class StreamResponse
*
* @since 8.1.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class StreamResponse extends Response implements ICallbackResponse {
/** @var string */
diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
index 1000f4db549..ef5d2f67f7e 100644
--- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
+++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
@@ -15,8 +15,8 @@ use OCP\IInitialStateService;
*
* @since 14.0.0
* @template H of array<string, mixed>
- * @template S of int
- * @template-extends TemplateResponse<int, array<string, mixed>>
+ * @template S of Http::STATUS_*
+ * @template-extends TemplateResponse<Http::STATUS_*, array<string, mixed>>
*/
class PublicTemplateResponse extends TemplateResponse {
private $headerTitle = '';
diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php
index 2c7567c080b..55b9f2b06af 100644
--- a/lib/public/AppFramework/Http/TemplateResponse.php
+++ b/lib/public/AppFramework/Http/TemplateResponse.php
@@ -13,9 +13,9 @@ use OCP\AppFramework\Http;
* Response for a normal template
* @since 6.0.0
*
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class TemplateResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/TextPlainResponse.php b/lib/public/AppFramework/Http/TextPlainResponse.php
index e7c728c37ab..9dfa2c5544d 100644
--- a/lib/public/AppFramework/Http/TextPlainResponse.php
+++ b/lib/public/AppFramework/Http/TextPlainResponse.php
@@ -12,9 +12,9 @@ use OCP\AppFramework\Http;
/**
* A renderer for text responses
* @since 22.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class TextPlainResponse extends Response {
/** @var string */
diff --git a/lib/public/AppFramework/Http/TooManyRequestsResponse.php b/lib/public/AppFramework/Http/TooManyRequestsResponse.php
index b7b0a98c9e1..6b2ef5b1b90 100644
--- a/lib/public/AppFramework/Http/TooManyRequestsResponse.php
+++ b/lib/public/AppFramework/Http/TooManyRequestsResponse.php
@@ -13,9 +13,9 @@ use OCP\Template;
/**
* A generic 429 response showing an 404 error page as well to the end-user
* @since 19.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class TooManyRequestsResponse extends Response {
/**
diff --git a/lib/public/AppFramework/Http/ZipResponse.php b/lib/public/AppFramework/Http/ZipResponse.php
index 3b9e251d332..a552eb1294f 100644
--- a/lib/public/AppFramework/Http/ZipResponse.php
+++ b/lib/public/AppFramework/Http/ZipResponse.php
@@ -15,9 +15,9 @@ use OCP\IRequest;
* Public library to send several files in one zip archive.
*
* @since 15.0.0
- * @template S of int
+ * @template S of Http::STATUS_*
* @template H of array<string, mixed>
- * @template-extends Response<int, array<string, mixed>>
+ * @template-extends Response<Http::STATUS_*, array<string, mixed>>
*/
class ZipResponse extends Response implements ICallbackResponse {
/** @var array{internalName: string, resource: resource, size: int, time: int}[] Files to be added to the zip response */
diff --git a/lib/public/AppFramework/Services/IInitialState.php b/lib/public/AppFramework/Services/IInitialState.php
index 24698108d68..ac58bcad3cc 100644
--- a/lib/public/AppFramework/Services/IInitialState.php
+++ b/lib/public/AppFramework/Services/IInitialState.php
@@ -37,7 +37,7 @@ interface IInitialState {
*
* @param string $key
* @param Closure $closure returns a primitive or an object that implements JsonSerializable
- * @psalm-param Closure():bool|Closure():int|Closure():float|Closure():string|Closure():\JsonSerializable $closure
+ * @psalm-param Closure():bool|Closure():int|Closure():float|Closure():string|Closure():array|Closure():\JsonSerializable $closure
*/
public function provideLazyInitialState(string $key, Closure $closure): void;
}