Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/maps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArne Hamann <git@arne.email>2022-06-16 13:21:59 +0300
committerArne Hamann <git@arne.email>2022-06-16 13:21:59 +0300
commitcb2b4eaf610c689afbea762186196ee577f52563 (patch)
treecca992601880dcebbef3b56a7b79090bf40b7416 /lib
parent9dea65a3520ee811e771fd982395808e3405312d (diff)
Added translation and typeDeclaration to PublicPageController
Signed-off-by: Arne Hamann <git@arne.email>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/PublicPageController.php51
1 files changed, 29 insertions, 22 deletions
diff --git a/lib/Controller/PublicPageController.php b/lib/Controller/PublicPageController.php
index 5a18498e..c8cd26e4 100644
--- a/lib/Controller/PublicPageController.php
+++ b/lib/Controller/PublicPageController.php
@@ -67,7 +67,7 @@ class PublicPageController extends PublicShareController {
* @PublicPage
* @NoCSRFRequired
*/
- public function sharedFavoritesCategory($token) {
+ public function sharedFavoritesCategory($token): DataResponse|PublicTemplateResponse {
if ($token === '') {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
@@ -95,25 +95,27 @@ class PublicPageController extends PublicShareController {
return $response;
}
- /**
- * Get a hash of the password for this share
- *
- * To ensure access is blocked when the password to a share is changed we store
- * a hash of the password for this token.
- *
- * @since 14.0.0
- */
+ /**
+ * Get a hash of the password for this share
+ *
+ * To ensure access is blocked when the password to a share is changed we store
+ * a hash of the password for this token.
+ *
+ * @return string
+ * @since 14.0.0
+ */
protected function getPasswordHash(): string {
return "";
}
- /**
- * Is the provided token a valid token
- *
- * This function is already called from the middleware directly after setting the token.
- *
- * @since 14.0.0
- */
+ /**
+ * Is the provided token a valid token
+ *
+ * This function is already called from the middleware directly after setting the token.
+ *
+ * @return bool
+ * @since 14.0.0
+ */
public function isValidToken(): bool {
try {
$this->favoriteShareMapper->findByToken($this->getToken());
@@ -124,16 +126,21 @@ class PublicPageController extends PublicShareController {
return true;
}
- /**
- * Is a share with this token password protected
- *
- * @since 14.0.0
- */
+ /**
+ * Is a share with this token password protected
+ *
+ * @return bool
+ * @since 14.0.0
+ */
protected function isPasswordProtected(): bool {
return false;
}
- private function addCsp($response) {
+ /**
+ * @param $response
+ * @return void
+ */
+ private function addCsp($response): void {
if (class_exists('OCP\AppFramework\Http\ContentSecurityPolicy')) {
$csp = new ContentSecurityPolicy();
// map tiles