aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Http/Attribute/RequestHeader.php24
-rw-r--r--lib/public/IPreview.php4
2 files changed, 7 insertions, 21 deletions
diff --git a/lib/public/AppFramework/Http/Attribute/RequestHeader.php b/lib/public/AppFramework/Http/Attribute/RequestHeader.php
index c9327eec4c0..1d0fbbfa0c3 100644
--- a/lib/public/AppFramework/Http/Attribute/RequestHeader.php
+++ b/lib/public/AppFramework/Http/Attribute/RequestHeader.php
@@ -21,30 +21,14 @@ use Attribute;
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class RequestHeader {
/**
- * @param string $name The name of the request header
- * @param string $description The description of the request header
+ * @param lowercase-string $name The name of the request header
+ * @param non-empty-string $description The description of the request header
+ * @param bool $indirect Allow indirect usage of the header for example in a middleware. Enabling this turns off the check which ensures that the header must be referenced in the controller method.
*/
public function __construct(
protected string $name,
protected string $description,
+ protected bool $indirect = false,
) {
}
-
- /**
- * @return string The name of the request header.
- *
- * @since 32.0.0
- */
- public function getName(): string {
- return $this->name;
- }
-
- /**
- * @return string The description of the request header.
- *
- * @since 32.0.0
- */
- public function getDescription(): string {
- return $this->description;
- }
}
diff --git a/lib/public/IPreview.php b/lib/public/IPreview.php
index 5a2bcde69f1..3c9eadd4577 100644
--- a/lib/public/IPreview.php
+++ b/lib/public/IPreview.php
@@ -92,10 +92,12 @@ interface IPreview {
* Check if a preview can be generated for a file
*
* @param \OCP\Files\FileInfo $file
+ * @param string|null $mimeType To force a given mimetype for the file
* @return bool
* @since 8.0.0
+ * @since 32.0.0 - isAvailable($mimeType) added the $mimeType argument to the signature
*/
- public function isAvailable(\OCP\Files\FileInfo $file);
+ public function isAvailable(\OCP\Files\FileInfo $file, ?string $mimeType = null);
/**
* Generates previews of a file