@@ -31,18 +31,18 @@ |
||
| 31 | 31 | |
| 32 | 32 | class MaxAutoCompleteResultsInitialState extends InitialStateProvider { |
| 33 | 33 | |
| 34 | - /** @var IConfig */ |
|
| 35 | - private $config; |
|
| 34 | + /** @var IConfig */ |
|
| 35 | + private $config; |
|
| 36 | 36 | |
| 37 | - public function __construct(IConfig $config) { |
|
| 38 | - $this->config = $config; |
|
| 39 | - } |
|
| 37 | + public function __construct(IConfig $config) { |
|
| 38 | + $this->config = $config; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getKey(): string { |
|
| 42 | - return 'maxAutoCompleteResults'; |
|
| 43 | - } |
|
| 41 | + public function getKey(): string { |
|
| 42 | + return 'maxAutoCompleteResults'; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function getData(): int { |
|
| 46 | - return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); |
|
| 47 | - } |
|
| 45 | + public function getData(): int { |
|
| 46 | + return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -43,6 +43,6 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function getData(): int { |
| 46 | - return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); |
|
| 46 | + return (int) $this->config->getAppValue('comments', 'maxAutoCompleteResults', '10'); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -49,48 +49,48 @@ |
||
| 49 | 49 | use OCP\IServerContainer; |
| 50 | 50 | |
| 51 | 51 | class Application extends App implements IBootstrap { |
| 52 | - public const APP_ID = 'comments'; |
|
| 52 | + public const APP_ID = 'comments'; |
|
| 53 | 53 | |
| 54 | - public function __construct(array $urlParams = []) { |
|
| 55 | - parent::__construct(self::APP_ID, $urlParams); |
|
| 56 | - } |
|
| 54 | + public function __construct(array $urlParams = []) { |
|
| 55 | + parent::__construct(self::APP_ID, $urlParams); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public function register(IRegistrationContext $context): void { |
|
| 59 | - $context->registerCapability(Capabilities::class); |
|
| 58 | + public function register(IRegistrationContext $context): void { |
|
| 59 | + $context->registerCapability(Capabilities::class); |
|
| 60 | 60 | |
| 61 | - $context->registerServiceAlias('NotificationsController', Notifications::class); |
|
| 61 | + $context->registerServiceAlias('NotificationsController', Notifications::class); |
|
| 62 | 62 | |
| 63 | - $context->registerEventListener( |
|
| 64 | - LoadAdditionalScriptsEvent::class, |
|
| 65 | - LoadAdditionalScripts::class |
|
| 66 | - ); |
|
| 67 | - $context->registerEventListener( |
|
| 68 | - LoadSidebar::class, |
|
| 69 | - LoadSidebarScripts::class |
|
| 70 | - ); |
|
| 71 | - $context->registerEventListener( |
|
| 72 | - CommentsEntityEvent::EVENT_ENTITY, |
|
| 73 | - CommentsEntityEventListener::class |
|
| 74 | - ); |
|
| 75 | - $context->registerSearchProvider(CommentsSearchProvider::class); |
|
| 63 | + $context->registerEventListener( |
|
| 64 | + LoadAdditionalScriptsEvent::class, |
|
| 65 | + LoadAdditionalScripts::class |
|
| 66 | + ); |
|
| 67 | + $context->registerEventListener( |
|
| 68 | + LoadSidebar::class, |
|
| 69 | + LoadSidebarScripts::class |
|
| 70 | + ); |
|
| 71 | + $context->registerEventListener( |
|
| 72 | + CommentsEntityEvent::EVENT_ENTITY, |
|
| 73 | + CommentsEntityEventListener::class |
|
| 74 | + ); |
|
| 75 | + $context->registerSearchProvider(CommentsSearchProvider::class); |
|
| 76 | 76 | |
| 77 | - $context->registerInitialStateProvider(MaxAutoCompleteResultsInitialState::class); |
|
| 78 | - } |
|
| 77 | + $context->registerInitialStateProvider(MaxAutoCompleteResultsInitialState::class); |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - public function boot(IBootContext $context): void { |
|
| 81 | - $context->injectFn(Closure::fromCallable([$this, 'registerNotifier'])); |
|
| 82 | - $context->injectFn(Closure::fromCallable([$this, 'registerCommentsEventHandler'])); |
|
| 80 | + public function boot(IBootContext $context): void { |
|
| 81 | + $context->injectFn(Closure::fromCallable([$this, 'registerNotifier'])); |
|
| 82 | + $context->injectFn(Closure::fromCallable([$this, 'registerCommentsEventHandler'])); |
|
| 83 | 83 | |
| 84 | - $context->getServerContainer()->get(ISearch::class)->registerProvider(LegacyProvider::class, ['apps' => ['files']]); |
|
| 85 | - } |
|
| 84 | + $context->getServerContainer()->get(ISearch::class)->registerProvider(LegacyProvider::class, ['apps' => ['files']]); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - protected function registerNotifier(IServerContainer $container) { |
|
| 88 | - $container->getNotificationManager()->registerNotifierService(Notifier::class); |
|
| 89 | - } |
|
| 87 | + protected function registerNotifier(IServerContainer $container) { |
|
| 88 | + $container->getNotificationManager()->registerNotifierService(Notifier::class); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - protected function registerCommentsEventHandler(IServerContainer $container) { |
|
| 92 | - $container->getCommentsManager()->registerEventHandler(function () { |
|
| 93 | - return $this->getContainer()->query(EventHandler::class); |
|
| 94 | - }); |
|
| 95 | - } |
|
| 91 | + protected function registerCommentsEventHandler(IServerContainer $container) { |
|
| 92 | + $container->getCommentsManager()->registerEventHandler(function () { |
|
| 93 | + return $this->getContainer()->query(EventHandler::class); |
|
| 94 | + }); |
|
| 95 | + } |
|
| 96 | 96 | } |
@@ -6,23 +6,23 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
| 10 | - 'OCA\\Comments\\Activity\\Filter' => $baseDir . '/../lib/Activity/Filter.php', |
|
| 11 | - 'OCA\\Comments\\Activity\\Listener' => $baseDir . '/../lib/Activity/Listener.php', |
|
| 12 | - 'OCA\\Comments\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', |
|
| 13 | - 'OCA\\Comments\\Activity\\Setting' => $baseDir . '/../lib/Activity/Setting.php', |
|
| 14 | - 'OCA\\Comments\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 15 | - 'OCA\\Comments\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
| 16 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir . '/../lib/Collaboration/CommentersSorter.php', |
|
| 17 | - 'OCA\\Comments\\Controller\\Notifications' => $baseDir . '/../lib/Controller/Notifications.php', |
|
| 18 | - 'OCA\\Comments\\EventHandler' => $baseDir . '/../lib/EventHandler.php', |
|
| 19 | - 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => $baseDir . '/../lib/Listener/CommentsEntityEventListener.php', |
|
| 20 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 21 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 22 | - 'OCA\\Comments\\MaxAutoCompleteResultsInitialState' => $baseDir . '/../lib/MaxAutoCompleteResultsInitialState.php', |
|
| 23 | - 'OCA\\Comments\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php', |
|
| 24 | - 'OCA\\Comments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 25 | - 'OCA\\Comments\\Search\\CommentsSearchProvider' => $baseDir . '/../lib/Search/CommentsSearchProvider.php', |
|
| 26 | - 'OCA\\Comments\\Search\\LegacyProvider' => $baseDir . '/../lib/Search/LegacyProvider.php', |
|
| 27 | - 'OCA\\Comments\\Search\\Result' => $baseDir . '/../lib/Search/Result.php', |
|
| 9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
| 10 | + 'OCA\\Comments\\Activity\\Filter' => $baseDir.'/../lib/Activity/Filter.php', |
|
| 11 | + 'OCA\\Comments\\Activity\\Listener' => $baseDir.'/../lib/Activity/Listener.php', |
|
| 12 | + 'OCA\\Comments\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', |
|
| 13 | + 'OCA\\Comments\\Activity\\Setting' => $baseDir.'/../lib/Activity/Setting.php', |
|
| 14 | + 'OCA\\Comments\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 15 | + 'OCA\\Comments\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
| 16 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir.'/../lib/Collaboration/CommentersSorter.php', |
|
| 17 | + 'OCA\\Comments\\Controller\\Notifications' => $baseDir.'/../lib/Controller/Notifications.php', |
|
| 18 | + 'OCA\\Comments\\EventHandler' => $baseDir.'/../lib/EventHandler.php', |
|
| 19 | + 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => $baseDir.'/../lib/Listener/CommentsEntityEventListener.php', |
|
| 20 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 21 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 22 | + 'OCA\\Comments\\MaxAutoCompleteResultsInitialState' => $baseDir.'/../lib/MaxAutoCompleteResultsInitialState.php', |
|
| 23 | + 'OCA\\Comments\\Notification\\Listener' => $baseDir.'/../lib/Notification/Listener.php', |
|
| 24 | + 'OCA\\Comments\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 25 | + 'OCA\\Comments\\Search\\CommentsSearchProvider' => $baseDir.'/../lib/Search/CommentsSearchProvider.php', |
|
| 26 | + 'OCA\\Comments\\Search\\LegacyProvider' => $baseDir.'/../lib/Search/LegacyProvider.php', |
|
| 27 | + 'OCA\\Comments\\Search\\Result' => $baseDir.'/../lib/Search/Result.php', |
|
| 28 | 28 | ); |
@@ -6,45 +6,45 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitComments |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\Comments\\' => 13, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\Comments\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
| 25 | - 'OCA\\Comments\\Activity\\Filter' => __DIR__ . '/..' . '/../lib/Activity/Filter.php', |
|
| 26 | - 'OCA\\Comments\\Activity\\Listener' => __DIR__ . '/..' . '/../lib/Activity/Listener.php', |
|
| 27 | - 'OCA\\Comments\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php', |
|
| 28 | - 'OCA\\Comments\\Activity\\Setting' => __DIR__ . '/..' . '/../lib/Activity/Setting.php', |
|
| 29 | - 'OCA\\Comments\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 30 | - 'OCA\\Comments\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
| 31 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__ . '/..' . '/../lib/Collaboration/CommentersSorter.php', |
|
| 32 | - 'OCA\\Comments\\Controller\\Notifications' => __DIR__ . '/..' . '/../lib/Controller/Notifications.php', |
|
| 33 | - 'OCA\\Comments\\EventHandler' => __DIR__ . '/..' . '/../lib/EventHandler.php', |
|
| 34 | - 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => __DIR__ . '/..' . '/../lib/Listener/CommentsEntityEventListener.php', |
|
| 35 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 36 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 37 | - 'OCA\\Comments\\MaxAutoCompleteResultsInitialState' => __DIR__ . '/..' . '/../lib/MaxAutoCompleteResultsInitialState.php', |
|
| 38 | - 'OCA\\Comments\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php', |
|
| 39 | - 'OCA\\Comments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
| 40 | - 'OCA\\Comments\\Search\\CommentsSearchProvider' => __DIR__ . '/..' . '/../lib/Search/CommentsSearchProvider.php', |
|
| 41 | - 'OCA\\Comments\\Search\\LegacyProvider' => __DIR__ . '/..' . '/../lib/Search/LegacyProvider.php', |
|
| 42 | - 'OCA\\Comments\\Search\\Result' => __DIR__ . '/..' . '/../lib/Search/Result.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
| 25 | + 'OCA\\Comments\\Activity\\Filter' => __DIR__.'/..'.'/../lib/Activity/Filter.php', |
|
| 26 | + 'OCA\\Comments\\Activity\\Listener' => __DIR__.'/..'.'/../lib/Activity/Listener.php', |
|
| 27 | + 'OCA\\Comments\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php', |
|
| 28 | + 'OCA\\Comments\\Activity\\Setting' => __DIR__.'/..'.'/../lib/Activity/Setting.php', |
|
| 29 | + 'OCA\\Comments\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 30 | + 'OCA\\Comments\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
| 31 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__.'/..'.'/../lib/Collaboration/CommentersSorter.php', |
|
| 32 | + 'OCA\\Comments\\Controller\\Notifications' => __DIR__.'/..'.'/../lib/Controller/Notifications.php', |
|
| 33 | + 'OCA\\Comments\\EventHandler' => __DIR__.'/..'.'/../lib/EventHandler.php', |
|
| 34 | + 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => __DIR__.'/..'.'/../lib/Listener/CommentsEntityEventListener.php', |
|
| 35 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__.'/..'.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 36 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 37 | + 'OCA\\Comments\\MaxAutoCompleteResultsInitialState' => __DIR__.'/..'.'/../lib/MaxAutoCompleteResultsInitialState.php', |
|
| 38 | + 'OCA\\Comments\\Notification\\Listener' => __DIR__.'/..'.'/../lib/Notification/Listener.php', |
|
| 39 | + 'OCA\\Comments\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
| 40 | + 'OCA\\Comments\\Search\\CommentsSearchProvider' => __DIR__.'/..'.'/../lib/Search/CommentsSearchProvider.php', |
|
| 41 | + 'OCA\\Comments\\Search\\LegacyProvider' => __DIR__.'/..'.'/../lib/Search/LegacyProvider.php', |
|
| 42 | + 'OCA\\Comments\\Search\\Result' => __DIR__.'/..'.'/../lib/Search/Result.php', |
|
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | public static function getInitializer(ClassLoader $loader) |
| 46 | 46 | { |
| 47 | - return \Closure::bind(function () use ($loader) { |
|
| 47 | + return \Closure::bind(function() use ($loader) { |
|
| 48 | 48 | $loader->prefixLengthsPsr4 = ComposerStaticInitComments::$prefixLengthsPsr4; |
| 49 | 49 | $loader->prefixDirsPsr4 = ComposerStaticInitComments::$prefixDirsPsr4; |
| 50 | 50 | $loader->classMap = ComposerStaticInitComments::$classMap; |