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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-09-10 12:37:53 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-09-12 15:44:55 +0300
commita1ef939c061686bab80d4ad3b457533803452343 (patch)
tree0705f106dcd182016204edac647821ac01eed77f /lib
parentac48a9ba61ec9cb7632bf67328b654f2a628a981 (diff)
Use Symfony's new contract Event class instead of the deprecated one
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Registry.php7
-rw-r--r--lib/public/EventDispatcher/Event.php18
-rw-r--r--lib/public/Security/CSP/AddContentSecurityPolicyEvent.php1
-rw-r--r--lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php1
4 files changed, 21 insertions, 6 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Registry.php b/lib/private/Authentication/TwoFactorAuth/Registry.php
index 2f905441953..791e9eb9954 100644
--- a/lib/private/Authentication/TwoFactorAuth/Registry.php
+++ b/lib/private/Authentication/TwoFactorAuth/Registry.php
@@ -30,20 +30,19 @@ use OC\Authentication\TwoFactorAuth\Db\ProviderUserAssignmentDao;
use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\Authentication\TwoFactorAuth\RegistryEvent;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IUser;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
class Registry implements IRegistry {
/** @var ProviderUserAssignmentDao */
private $assignmentDao;
- /** @var EventDispatcherInterface */
+ /** @var IEventDispatcher */
private $dispatcher;
public function __construct(ProviderUserAssignmentDao $assignmentDao,
- EventDispatcherInterface $dispatcher) {
+ IEventDispatcher $dispatcher) {
$this->assignmentDao = $assignmentDao;
$this->dispatcher = $dispatcher;
}
diff --git a/lib/public/EventDispatcher/Event.php b/lib/public/EventDispatcher/Event.php
index 7f8554d7a86..368f352292e 100644
--- a/lib/public/EventDispatcher/Event.php
+++ b/lib/public/EventDispatcher/Event.php
@@ -25,7 +25,7 @@ declare(strict_types=1);
namespace OCP\EventDispatcher;
-use Symfony\Component\EventDispatcher\GenericEvent;
+use Symfony\Contracts\EventDispatcher\Event as SymfonyEvent;
/**
* Base event class for the event dispatcher service
@@ -35,6 +35,20 @@ use Symfony\Component\EventDispatcher\GenericEvent;
*
* @since 17.0.0
*/
-class Event extends GenericEvent {
+class Event extends SymfonyEvent {
+
+ /**
+ * Compatibility constructor
+ *
+ * In Nextcloud 17.0.0 this event class used a now deprecated/removed Symfony base
+ * class that had a constructor (with default arguments). To lower the risk of
+ * a breaking change (PHP won't allow parent constructor calls if there is none),
+ * this empty constructor's only purpose is to hopefully not break existing sub-
+ * classes of this class.
+ *
+ * @since 18.0.0
+ */
+ public function __construct() {
+ }
}
diff --git a/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php b/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php
index 9bf1d57e77e..9c48f4038d8 100644
--- a/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php
+++ b/lib/public/Security/CSP/AddContentSecurityPolicyEvent.php
@@ -40,6 +40,7 @@ class AddContentSecurityPolicyEvent extends Event {
* @since 17.0.0
*/
public function __construct(ContentSecurityPolicyManager $policyManager) {
+ parent::__construct();
$this->policyManager = $policyManager;
}
diff --git a/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php b/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php
index ab93844c3f8..e840f910769 100644
--- a/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php
+++ b/lib/public/Security/FeaturePolicy/AddFeaturePolicyEvent.php
@@ -40,6 +40,7 @@ class AddFeaturePolicyEvent extends Event {
* @since 17.0.0
*/
public function __construct(FeaturePolicyManager $policyManager) {
+ parent::__construct();
$this->policyManager = $policyManager;
}