diff --git a/appinfo/application.php b/appinfo/application.php index 67a091ec..eff730f6 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -42,6 +42,11 @@ use OCA\Onlyoffice\Notifier; use OCA\Onlyoffice\Preview; +/** + * Class Application + * + * @package OCA\Onlyoffice\AppInfo + */ class Application extends App { /** * Application configuration @@ -57,6 +62,11 @@ class Application extends App { */ public $crypt; + /** + * Application constructor. + * + * @param array $urlParams + */ public function __construct(array $urlParams = []) { $appName = "onlyoffice"; diff --git a/controller/callbackcontroller.php b/controller/callbackcontroller.php index 904b286a..b01f7adb 100644 --- a/controller/callbackcontroller.php +++ b/controller/callbackcontroller.php @@ -777,6 +777,8 @@ private function parseUserId($userId) { * @param callable $operation * * @throws LockedException + * + * @return void */ private function retryOperation(callable $operation) { $i = 0; diff --git a/controller/editorapicontroller.php b/controller/editorapicontroller.php index 86d8ce6c..ade9e77c 100644 --- a/controller/editorapicontroller.php +++ b/controller/editorapicontroller.php @@ -136,7 +136,7 @@ class EditorApiController extends OCSController { * @param AppConfig $config - application configuration * @param Crypt $crypt - hash generator * @param IManager $shareManager - Share manager - * @param ISession $ISession - Session + * @param ISession $session - Session * @param ITagManager $tagManager - Tag manager */ public function __construct( @@ -233,6 +233,7 @@ public function fillempty($fileId) { * @param bool $inframe - open in frame * @param bool $desktop - desktop label * @param bool $template - file is template + * @param string $anchor - anchor link * * @return JSONResponse * @@ -668,7 +669,7 @@ private function buildUserId($userId) { /** * Set customization parameters * - * @param array params - file parameters + * @param array $params - file parameters * * @return array */ diff --git a/controller/federationcontroller.php b/controller/federationcontroller.php index b229d68b..a84b777b 100644 --- a/controller/federationcontroller.php +++ b/controller/federationcontroller.php @@ -66,7 +66,7 @@ class FederationController extends OCSController { * @param IL10N $trans - l10n service * @param ILogger $logger - logger * @param IManager $shareManager - Share manager - * @param IManager $ISession - Session + * @param IManager $session - Session */ public function __construct( $AppName, diff --git a/controller/joblistcontroller.php b/controller/joblistcontroller.php index 1670638a..76b80928 100644 --- a/controller/joblistcontroller.php +++ b/controller/joblistcontroller.php @@ -81,6 +81,8 @@ public function __construct($AppName, IRequest $request, ILogger $logger, AppCon * Add a job to list * * @param IJob|string $job + * + * @return void */ private function addJob($job) { if (!$this->jobList->has($job, null)) { @@ -93,6 +95,8 @@ private function addJob($job) { * Remove a job from list * * @param IJob|string $job + * + * @return void */ private function removeJob($job) { if ($this->jobList->has($job, null)) { @@ -104,6 +108,7 @@ private function removeJob($job) { /** * Add or remove EditorsCheck job depending on the value of _editors_check_interval * + * @return void */ private function checkEditorsCheckJob() { if ($this->config->GetEditorsCheckInterval() > 0) { @@ -116,6 +121,7 @@ private function checkEditorsCheckJob() { /** * Method for sequentially calling checks of all jobs * + * @return void */ public function checkAllJobs() { $this->checkEditorsCheckJob(); diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 55faa4a4..20bd62e3 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -141,12 +141,12 @@ public function index() { /** * Save address settings * - * @param string $jwtHeader - jwt header * @param string $documentserver - document service address * @param string $documentserverInternal - document service address available from ownCloud * @param string $storageUrl - ownCloud address available from document server * @param bool $verifyPeerOff - parameter verification setting * @param string $secret - secret key for signature + * @param string $jwtHeader - jwt header * @param bool $demo - use demo server * * @return array diff --git a/controller/templatecontroller.php b/controller/templatecontroller.php index 0e7b7a71..301b671d 100644 --- a/controller/templatecontroller.php +++ b/controller/templatecontroller.php @@ -49,6 +49,7 @@ class TemplateController extends Controller { * @param string $AppName - application name * @param IRequest $request - request object * @param IL10N $trans - l10n service + * @param ILogger $logger - logger */ public function __construct( $AppName, @@ -134,6 +135,8 @@ public function AddTemplate() { * Delete template * * @param string $templateId - file identifier + * + * @return array */ public function DeleteTemplate($templateId) { $templateDir = TemplateManager::GetGlobalTemplateDir(); diff --git a/lib/adminsettings.php b/lib/adminsettings.php index 48aa6a57..bcf15d28 100644 --- a/lib/adminsettings.php +++ b/lib/adminsettings.php @@ -26,6 +26,10 @@ * Settings controller for the administration page */ class AdminSettings implements ISettings { + + /** + * Constructor + */ public function __construct() { } diff --git a/lib/appconfig.php b/lib/appconfig.php index 028dd1f6..b6523723 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -403,6 +403,8 @@ public function UseDemo() { * Save the document service address to the application configuration * * @param string $documentServer - document service address + * + * @return void */ public function SetDocumentServerUrl($documentServer) { $documentServer = trim($documentServer); @@ -447,6 +449,8 @@ public function GetDocumentServerUrl($origin = false) { * Save the document service address available from ownCloud to the application configuration * * @param string $documentServerInternal - document service address + * + * @return void */ public function SetDocumentServerInternalUrl($documentServerInternal) { $documentServerInternal = rtrim(trim($documentServerInternal), "/"); @@ -514,6 +518,8 @@ public function ReplaceDocumentServerUrlToInternal($url) { * Save the ownCloud address available from document server to the application configuration * * @param string $documentServer - document service address + * + * @return void */ public function SetStorageUrl($storageUrl) { $storageUrl = rtrim(trim($storageUrl), "/"); @@ -546,6 +552,8 @@ public function GetStorageUrl() { * Save the document service secret key to the application configuration * * @param string $secret - secret key + * + * @return void */ public function SetDocumentServerSecret($secret) { $secret = trim($secret); @@ -594,6 +602,8 @@ public function GetSKey() { * Save an array of formats with default action * * @param array $formats - formats with status + * + * @return void */ public function SetDefaultFormats($formats) { $value = json_encode($formats); @@ -619,6 +629,8 @@ private function GetDefaultFormats() { * Save an array of formats that is opened for editing * * @param array $formats - formats with status + * + * @return void */ public function SetEditableFormats($formats) { $value = json_encode($formats); @@ -644,6 +656,8 @@ private function GetEditableFormats() { * Save the opening setting in a same tab * * @param bool $value - same tab + * + * @return void */ public function SetSameTab($value) { $this->logger->info("Set opening in a same tab: " . json_encode($value), ["app" => $this->appName]); @@ -664,6 +678,8 @@ public function GetSameTab() { * Save generate preview setting * * @param bool $value - preview + * + * @return bool */ public function SetPreview($value) { $this->logger->info("Set generate preview: " . json_encode($value), ["app" => $this->appName]); @@ -684,6 +700,8 @@ public function GetPreview() { * Save keep versions history * * @param bool $value - version history + * + * @return void */ public function SetVersionHistory($value) { $this->logger->info("Set keep versions history: " . json_encode($value), ["app" => $this->appName]); @@ -704,6 +722,8 @@ public function GetVersionHistory() { * Save protection * * @param bool $value - version history + * + * @return void */ public function SetProtection($value) { $this->logger->info("Set protection: " . $value, ["app" => $this->appName]); @@ -714,7 +734,7 @@ public function SetProtection($value) { /** * Get protection * - * @return bool + * @return string */ public function GetProtection() { $value = $this->config->getAppValue($this->appName, $this->_protection, "owner"); @@ -728,6 +748,8 @@ public function GetProtection() { * Save chat display setting * * @param bool $value - display chat + * + * @return void */ public function SetCustomizationChat($value) { $this->logger->info("Set chat display: " . json_encode($value), ["app" => $this->appName]); @@ -748,6 +770,8 @@ public function GetCustomizationChat() { * Save compact header setting * * @param bool $value - display compact header + * + * @return void */ public function SetCustomizationCompactHeader($value) { $this->logger->info("Set compact header display: " . json_encode($value), ["app" => $this->appName]); @@ -768,6 +792,8 @@ public function GetCustomizationCompactHeader() { * Save feedback display setting * * @param bool $value - display feedback + * + * @return void */ public function SetCustomizationFeedback($value) { $this->logger->info("Set feedback display: " . json_encode($value), ["app" => $this->appName]); @@ -788,6 +814,8 @@ public function GetCustomizationFeedback() { * Save forcesave setting * * @param bool $value - forcesave + * + * @return void */ public function SetCustomizationForcesave($value) { $this->logger->info("Set forcesave: " . json_encode($value), ["app" => $this->appName]); @@ -810,6 +838,8 @@ public function GetCustomizationForcesave() { * Save help display setting * * @param bool $value - display help + * + * @return void */ public function SetCustomizationHelp($value) { $this->logger->info("Set help display: " . json_encode($value), ["app" => $this->appName]); @@ -830,6 +860,8 @@ public function GetCustomizationHelp() { * Save without tabs setting * * @param bool $value - without tabs + * + * @return void */ public function SetCustomizationToolbarNoTabs($value) { $this->logger->info("Set without tabs: " . json_encode($value), ["app" => $this->appName]); @@ -850,6 +882,8 @@ public function GetCustomizationToolbarNoTabs() { * Save review viewing mode setting * * @param string $value - review mode + * + * @return void */ public function SetCustomizationReviewDisplay($value) { $this->logger->info("Set review mode: " . $value, ["app" => $this->appName]); @@ -877,6 +911,8 @@ public function GetCustomizationReviewDisplay() { * Save theme setting * * @param string $value - theme + * + * @return void */ public function SetCustomizationTheme($value) { $this->logger->info("Set theme: " . $value, ["app" => $this->appName]); @@ -904,6 +940,8 @@ public function GetCustomizationTheme() { * Save macros setting * * @param bool $value - enable macros + * + * @return void */ public function SetCustomizationMacros($value) { $this->logger->info("Set macros enabled: " . json_encode($value), ["app" => $this->appName]); @@ -924,6 +962,8 @@ public function GetCustomizationMacros() { * Save plugins setting * * @param bool $value - enable macros + * + * @return void */ public function SetCustomizationPlugins($value) { $this->logger->info("Set plugins enabled: " . json_encode($value), ["app" => $this->appName]); @@ -944,6 +984,8 @@ public function GetCustomizationPlugins() { * Save the list of groups * * @param array $groups - the list of groups + * + * @return void */ public function SetLimitGroups($groups) { if (!\is_array($groups)) { @@ -1021,6 +1063,8 @@ public function isUserAllowedToUse($userId = null) { * Save the document service verification setting to the application configuration * * @param bool $verifyPeerOff - parameter verification setting + * + * @return void */ public function SetVerifyPeerOff($verifyPeerOff) { $this->logger->info("SetVerifyPeerOff " . json_encode($verifyPeerOff), ["app" => $this->appName]); @@ -1084,6 +1128,8 @@ public function JwtHeader($origin = false) { * Save the jwtHeader setting * * @param string $value - jwtHeader + * + * @return void */ public function SetJwtHeader($value) { $value = trim($value); @@ -1111,6 +1157,8 @@ public function GetJwtLeeway() { * Save the status settings * * @param string $value - error + * + * @return void */ public function SetSettingsError($value) { $this->config->setAppValue($this->appName, $this->_settingsError, $value); @@ -1174,6 +1222,11 @@ public function FormatsSetting() { return $result; } + /** + * Get version of share attributes + * + * @return string + */ public function ShareAttributesVersion() { if (\version_compare(\implode(".", \OCP\Util::getVersion()), "10.3.0", ">=")) { return "v2"; diff --git a/lib/command/documentserver.php b/lib/command/documentserver.php index 2e984624..662ebc8c 100644 --- a/lib/command/documentserver.php +++ b/lib/command/documentserver.php @@ -32,6 +32,11 @@ use OCA\Onlyoffice\DocumentService; use OCA\Onlyoffice\Crypt; +/** + * Class Document Server + * + * @package OCA\Onlyoffice\Command + */ class DocumentServer extends Command { /** * Application configuration @@ -82,6 +87,8 @@ public function __construct( /** * Configures the current command. + * + * @return void */ protected function configure() { $this diff --git a/lib/cron/editorscheck.php b/lib/cron/editorscheck.php index 61ee5e13..b5d2dcbf 100644 --- a/lib/cron/editorscheck.php +++ b/lib/cron/editorscheck.php @@ -94,6 +94,7 @@ class EditorsCheck extends TimedJob { * @param AppConfig $config - application configuration * @param IL10N $trans - l10n service * @param Crypt $crypt - crypt service + * @param IGroupManager $groupManager - group manager */ public function __construct( string $AppName, @@ -119,6 +120,8 @@ public function __construct( * Makes the background check * * @param array $argument unused argument + * + * @return void */ protected function run($argument) { if (empty($this->config->GetDocumentServerUrl())) { diff --git a/lib/crypt.php b/lib/crypt.php index 1d4e3634..588b1643 100644 --- a/lib/crypt.php +++ b/lib/crypt.php @@ -36,7 +36,7 @@ class Crypt { private $config; /** - * @param AppConfig $config - application configutarion + * @param AppConfig $appConfig - application configutarion */ public function __construct(AppConfig $appConfig) { $this->config = $appConfig; diff --git a/lib/documentservice.php b/lib/documentservice.php index 608ba2e3..b2b0f3b0 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -53,7 +53,7 @@ class DocumentService { /** * @param IL10N $trans - l10n service - * @param AppConfig $config - application configutarion + * @param AppConfig $appConfig - application configutarion */ public function __construct(IL10N $trans, AppConfig $appConfig) { $this->trans = $trans; diff --git a/lib/fileutility.php b/lib/fileutility.php index c74644e9..658ebc41 100644 --- a/lib/fileutility.php +++ b/lib/fileutility.php @@ -87,7 +87,7 @@ class FileUtility { * @param ILogger $logger - logger * @param AppConfig $config - application configuration * @param IManager $shareManager - Share manager - * @param IManager $ISession - Session + * @param ISession $session - Session */ public function __construct( $AppName, diff --git a/lib/fileversions.php b/lib/fileversions.php index ad43d634..f77df852 100644 --- a/lib/fileversions.php +++ b/lib/fileversions.php @@ -242,8 +242,10 @@ public static function getChangesFile($ownerId, $fileId, $versionId) { * * @param FileInfo $fileInfo - file info * @param array $history - file history - * @param string $changesurl - file changes + * @param string $changes - file changes * @param string $prevVersion - previous version for check + * + * @return void */ public static function saveHistory($fileInfo, $history, $changes, $prevVersion) { $logger = \OC::$server->getLogger(); @@ -292,6 +294,8 @@ public static function saveHistory($fileInfo, $history, $changes, $prevVersion) * * @param string $ownerId - file owner id * @param string $fileId - file id + * + * @return void */ public static function deleteAllVersions($ownerId, $fileId = null) { $logger = \OC::$server->getLogger(); @@ -316,6 +320,8 @@ public static function deleteAllVersions($ownerId, $fileId = null) { * @param string $ownerId - file owner id * @param string $fileId - file id * @param string $versionId - file version + * + * @return void|null */ public static function deleteVersion($ownerId, $fileId, $versionId) { $logger = \OC::$server->getLogger(); @@ -349,6 +355,8 @@ public static function deleteVersion($ownerId, $fileId, $versionId) { /** * Clear all version history + * + * @return void */ public static function clearHistory() { $logger = \OC::$server->getLogger(); @@ -374,6 +382,8 @@ public static function clearHistory() { * * @param FileInfo $fileInfo - file info * @param IUser $author - version author + * + * @return void */ public static function saveAuthor($fileInfo, $author) { $logger = \OC::$server->getLogger(); @@ -451,6 +461,8 @@ public static function getAuthor($ownerId, $fileId, $versionId) { * @param string $ownerId - file owner id * @param string $fileId - file id * @param string $versionId - file version + * + * @return void|null */ public static function deleteAuthor($ownerId, $fileId, $versionId) { $logger = \OC::$server->getLogger(); diff --git a/lib/hookhandler.php b/lib/hookhandler.php index 116bb29d..d0684f19 100644 --- a/lib/hookhandler.php +++ b/lib/hookhandler.php @@ -27,11 +27,15 @@ /** * Class HookHandler * - * handles hooks - * * @package OCA\Onlyoffice */ class HookHandler { + + /** + * Adds scripts and styles + * + * @return void + */ public static function PublicPage() { $appName = "onlyoffice"; diff --git a/lib/hooks.php b/lib/hooks.php index 7f6e7782..66a5d002 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -40,6 +40,11 @@ class Hooks { */ private static $appName = "onlyoffice"; + /** + * Connect hooks + * + * @return void + */ public static function connectHooks() { // Listen user deletion Util::connectHook("OC_User", "pre_deleteUser", Hooks::class, "userDelete"); @@ -61,6 +66,8 @@ public static function connectHooks() { * Erase user file versions * * @param array $params - hook params + * + * @return void */ public static function userDelete($params) { $userId = $params["uid"]; @@ -72,6 +79,8 @@ public static function userDelete($params) { * Listen of file change * * @param array $params - hook params + * + * @return void */ public static function fileUpdate($params) { $filePath = $params[Filesystem::signal_param_path]; @@ -95,6 +104,8 @@ public static function fileUpdate($params) { * Erase versions of deleted file * * @param array $params - hook params + * + * @return void */ public static function fileDelete($params) { $filePath = $params[Filesystem::signal_param_path]; @@ -124,6 +135,8 @@ public static function fileDelete($params) { * Erase versions of deleted version of file * * @param array $params - hook param + * + * @return void */ public static function fileVersionDelete($params) { $pathVersion = $params["path"]; @@ -157,6 +170,8 @@ public static function fileVersionDelete($params) { * Erase versions of restored version of file * * @param array $params - hook param + * + * @return void */ public static function fileVersionRestore($params) { $filePath = $params["path"]; diff --git a/lib/notifier.php b/lib/notifier.php index 8f40c08b..b641dfb4 100644 --- a/lib/notifier.php +++ b/lib/notifier.php @@ -27,6 +27,11 @@ use OCP\Notification\INotification; use OCP\Notification\INotifier; +/** + * Class Notifier + * + * @package OCA\Onlyoffice + */ class Notifier implements INotifier { /** * Application name @@ -64,8 +69,8 @@ class Notifier implements INotifier { private $userManager; /** - * @param string $AppName - application name - * @param IFactory $l10NFactory - l10n + * @param string $appName - application name + * @param IFactory $l10nFactory - l10n * @param IURLGenerator $urlGenerator - url generator service * @param ILogger $logger - logger * @param IUserManager $userManager - user manager diff --git a/lib/preview.php b/lib/preview.php index 88362a27..6e7fdc69 100644 --- a/lib/preview.php +++ b/lib/preview.php @@ -199,6 +199,8 @@ public function __construct( /** * Return mime type + * + * @return string */ public static function getMimeTypeRegex() { $mimeTypeRegex = ""; @@ -215,6 +217,8 @@ public static function getMimeTypeRegex() { /** * Return mime type + * + * @return string */ public function getMimeType() { $m = self::getMimeTypeRegex(); diff --git a/lib/version.php b/lib/version.php index e7f0273b..228b8156 100644 --- a/lib/version.php +++ b/lib/version.php @@ -59,6 +59,7 @@ class Version { /** * @param int $timestamp - file time stamp * @param int $revisionId - revision id + * @param string $path - file path * @param FileInfo $sourceFileInfo - source file info */ public function __construct( diff --git a/lib/versionmanager.php b/lib/versionmanager.php index f0cb56b1..782f41da 100644 --- a/lib/versionmanager.php +++ b/lib/versionmanager.php @@ -169,6 +169,7 @@ public function getVersionsForFile($user, $file) { * * @param Version $version - version for restore * + * @return void */ public function rollback($version) { $sourceFile = $version->getSourceFile(); diff --git a/settings.php b/settings.php index 0a613f16..c474cf38 100644 --- a/settings.php +++ b/settings.php @@ -1,6 +1,7 @@ + * * (c) Copyright Ascensio System SIA 2023 * * Licensed under the Apache License, Version 2.0 (the "License");