Skip to content

Commit

Permalink
Merge pull request #18349 from nextcloud/techdebt/deprecate-hooks-emi…
Browse files Browse the repository at this point in the history
…tter-symfony-dispatcher

Deprecate hooks, emitter and Symfony dispatcher mechanisms
  • Loading branch information
ChristophWurst authored Dec 11, 2019
2 parents 9a40ccf + 723f017 commit db44cc8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/private/Hooks/BasicEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

namespace OC\Hooks;

/**
* @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
*/
abstract class BasicEmitter implements Emitter {
use EmitterTrait;
}
1 change: 1 addition & 0 deletions lib/private/Hooks/Emitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* interface for all classes that are able to emit events
*
* @package OC\Hooks
* @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
*/
interface Emitter {
/**
Expand Down
3 changes: 3 additions & 0 deletions lib/private/Hooks/PublicEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

namespace OC\Hooks;

/**
* @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
*/
class PublicEmitter extends BasicEmitter {
/**
* @param string $scope
Expand Down
1 change: 1 addition & 0 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1848,6 +1848,7 @@ public function getCapabilitiesManager() {
*
* @return EventDispatcherInterface
* @since 8.2.0
* @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher
*/
public function getEventDispatcher() {
return $this->query(\OC\EventDispatcher\SymfonyAdapter::class);
Expand Down
6 changes: 5 additions & 1 deletion lib/private/legacy/hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
class OC_Hook{

/**
* @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
*/
class OC_Hook {
public static $thrownExceptions = [];

static private $registered = array();
Expand Down

0 comments on commit db44cc8

Please sign in to comment.