From 782a2df39290fed1b2f1aa921727c41815dcbe1e Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 10 Aug 2020 14:24:24 +0200 Subject: [PATCH] Add PHP doc for events Signed-off-by: Morris Jobke --- apps/files/lib/Event/LoadAdditionalScriptsEvent.php | 5 +++++ lib/public/Authentication/Events/LoginFailedEvent.php | 4 +--- lib/public/DirectEditing/RegisterDirectEditorEvent.php | 2 ++ lib/public/Mail/Events/BeforeMessageSent.php | 2 ++ .../Security/CSP/AddContentSecurityPolicyEvent.php | 10 ++++++++++ .../Security/FeaturePolicy/AddFeaturePolicyEvent.php | 2 ++ lib/public/User/Events/BeforePasswordUpdatedEvent.php | 2 ++ lib/public/User/Events/BeforeUserCreatedEvent.php | 2 ++ .../User/Events/BeforeUserLoggedInWithCookieEvent.php | 2 ++ lib/public/User/Events/BeforeUserLoggedOutEvent.php | 2 ++ lib/public/User/Events/PasswordUpdatedEvent.php | 2 ++ lib/public/User/Events/UserCreatedEvent.php | 2 ++ lib/public/User/Events/UserLoggedInWithCookieEvent.php | 2 ++ lib/public/User/Events/UserLoggedOutEvent.php | 2 ++ .../WorkflowEngine/Events/LoadSettingsScriptsEvent.php | 2 ++ 15 files changed, 40 insertions(+), 3 deletions(-) diff --git a/apps/files/lib/Event/LoadAdditionalScriptsEvent.php b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php index d9c80a23207..458ec916f8f 100644 --- a/apps/files/lib/Event/LoadAdditionalScriptsEvent.php +++ b/apps/files/lib/Event/LoadAdditionalScriptsEvent.php @@ -28,6 +28,11 @@ namespace OCA\Files\Event; use OCP\EventDispatcher\Event; +/** + * This event is triggered when the files app is rendered. It canb e used to add additional scripts to the files app. + * + * @since 17.0.0 + */ class LoadAdditionalScriptsEvent extends Event { private $hiddenFields = []; diff --git a/lib/public/Authentication/Events/LoginFailedEvent.php b/lib/public/Authentication/Events/LoginFailedEvent.php index b946ba0c664..1e0a66a0b99 100644 --- a/lib/public/Authentication/Events/LoginFailedEvent.php +++ b/lib/public/Authentication/Events/LoginFailedEvent.php @@ -29,9 +29,7 @@ namespace OCP\Authentication\Events; use OCP\EventDispatcher\Event; /** - * Class LoginFailedEvent - * - * @package OCP\Authentication\Events + * Emitted when the authentication fails, but only if the login name can be associated with an existing user. * * @since 19.0.0 */ diff --git a/lib/public/DirectEditing/RegisterDirectEditorEvent.php b/lib/public/DirectEditing/RegisterDirectEditorEvent.php index c9e04f23cfc..d01bf92c58f 100644 --- a/lib/public/DirectEditing/RegisterDirectEditorEvent.php +++ b/lib/public/DirectEditing/RegisterDirectEditorEvent.php @@ -26,6 +26,8 @@ namespace OCP\DirectEditing; use OCP\EventDispatcher\Event; /** + * Event to allow to register the direct editor. + * * @since 18.0.0 */ class RegisterDirectEditorEvent extends Event { diff --git a/lib/public/Mail/Events/BeforeMessageSent.php b/lib/public/Mail/Events/BeforeMessageSent.php index f9dc834c9b6..f11b2415148 100644 --- a/lib/public/Mail/Events/BeforeMessageSent.php +++ b/lib/public/Mail/Events/BeforeMessageSent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\Mail\IMessage; /** + * Emitted before a system mail is sent. It can be used to alter the message. + * * @since 19.0.0 */ class BeforeMessageSent extends Event { diff --git a/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php b/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php index bcb25867075..2806cf72871 100644 --- a/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php +++ b/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php @@ -32,6 +32,16 @@ use OCP\AppFramework\Http\EmptyContentSecurityPolicy; use OCP\EventDispatcher\Event; /** + * Allows to inject something into the default content policy. This is for + * example useful when you're injecting Javascript code into a view belonging + * to another controller and cannot modify its Content-Security-Policy itself. + * Note that the adjustment is only applied to applications that use AppFramework + * controllers. + * + * WARNING: Using this API incorrectly may make the instance more insecure. + * Do think twice before adding whitelisting resources. Please do also note + * that it is not possible to use the `disallowXYZ` functions. + * * @since 17.0.0 */ class AddContentSecurityPolicyEvent extends Event { diff --git a/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php b/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php index a900960c612..d349cb3f6f3 100644 --- a/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php +++ b/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php @@ -32,6 +32,8 @@ use OCP\AppFramework\Http\EmptyFeaturePolicy; use OCP\EventDispatcher\Event; /** + * Event that allows to register a feature policy header to a request. + * * @since 17.0.0 */ class AddFeaturePolicyEvent extends Event { diff --git a/lib/public/User/Events/BeforePasswordUpdatedEvent.php b/lib/public/User/Events/BeforePasswordUpdatedEvent.php index 85d609e672f..e2abddfd084 100644 --- a/lib/public/User/Events/BeforePasswordUpdatedEvent.php +++ b/lib/public/User/Events/BeforePasswordUpdatedEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted before the user password is updated. + * * @since 18.0.0 */ class BeforePasswordUpdatedEvent extends Event { diff --git a/lib/public/User/Events/BeforeUserCreatedEvent.php b/lib/public/User/Events/BeforeUserCreatedEvent.php index ace929b8ee0..3ef55a185bb 100644 --- a/lib/public/User/Events/BeforeUserCreatedEvent.php +++ b/lib/public/User/Events/BeforeUserCreatedEvent.php @@ -29,6 +29,8 @@ namespace OCP\User\Events; use OCP\EventDispatcher\Event; /** + * Emitted before a new user is created on the back-end. + * * @since 18.0.0 */ class BeforeUserCreatedEvent extends Event { diff --git a/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php b/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php index 7a4ff823f8a..07e7d30aadf 100644 --- a/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php +++ b/lib/public/User/Events/BeforeUserLoggedInWithCookieEvent.php @@ -29,6 +29,8 @@ namespace OCP\User\Events; use OCP\EventDispatcher\Event; /** + * Emitted before a user is logged in via remember-me cookies. + * * @since 18.0.0 */ class BeforeUserLoggedInWithCookieEvent extends Event { diff --git a/lib/public/User/Events/BeforeUserLoggedOutEvent.php b/lib/public/User/Events/BeforeUserLoggedOutEvent.php index d470ec5de7f..db60a053ba0 100644 --- a/lib/public/User/Events/BeforeUserLoggedOutEvent.php +++ b/lib/public/User/Events/BeforeUserLoggedOutEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted before a user is logged out. + * * @since 18.0.0 */ class BeforeUserLoggedOutEvent extends Event { diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php index 8913dc4c53a..25e6efc80cc 100644 --- a/lib/public/User/Events/PasswordUpdatedEvent.php +++ b/lib/public/User/Events/PasswordUpdatedEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted when the user password has been updated. + * * @since 18.0.0 */ class PasswordUpdatedEvent extends Event { diff --git a/lib/public/User/Events/UserCreatedEvent.php b/lib/public/User/Events/UserCreatedEvent.php index 4d5bb2c5b79..4f2364e5c44 100644 --- a/lib/public/User/Events/UserCreatedEvent.php +++ b/lib/public/User/Events/UserCreatedEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted when a new user has been created on the back-end. + * * @since 18.0.0 */ class UserCreatedEvent extends Event { diff --git a/lib/public/User/Events/UserLoggedInWithCookieEvent.php b/lib/public/User/Events/UserLoggedInWithCookieEvent.php index 2827af3f90c..9ef84284151 100644 --- a/lib/public/User/Events/UserLoggedInWithCookieEvent.php +++ b/lib/public/User/Events/UserLoggedInWithCookieEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted when a user has been succesfully logged in via remember-me cookies. + * * @since 18.0.0 */ class UserLoggedInWithCookieEvent extends Event { diff --git a/lib/public/User/Events/UserLoggedOutEvent.php b/lib/public/User/Events/UserLoggedOutEvent.php index 3b1f8745dfe..5791ec77d90 100644 --- a/lib/public/User/Events/UserLoggedOutEvent.php +++ b/lib/public/User/Events/UserLoggedOutEvent.php @@ -30,6 +30,8 @@ use OCP\EventDispatcher\Event; use OCP\IUser; /** + * Emitted when a user has been logged out successfully. + * * @since 18.0.0 */ class UserLoggedOutEvent extends Event { diff --git a/lib/public/WorkflowEngine/Events/LoadSettingsScriptsEvent.php b/lib/public/WorkflowEngine/Events/LoadSettingsScriptsEvent.php index 56fddc84031..6008f397952 100644 --- a/lib/public/WorkflowEngine/Events/LoadSettingsScriptsEvent.php +++ b/lib/public/WorkflowEngine/Events/LoadSettingsScriptsEvent.php @@ -28,6 +28,8 @@ namespace OCP\WorkflowEngine\Events; use OCP\EventDispatcher\Event; /** + * Emitted when the workflow engine settings page is loaded. + * * @since 20.0.0 */ class LoadSettingsScriptsEvent extends Event { -- 2.39.5