1313$ app = App::get ();
1414
1515$ app ->bearCMS ->addons
16- ->register ('bearcms/forums-addon ' , function (\BearCMS \Addons \Addon $ addon ) use ($ app ) {
17- $ addon ->initialize = function (array $ options ) use ($ app ) {
16+ ->register ('bearcms/forums-addon ' , function (\BearCMS \Addons \Addon $ addon ) use ($ app ): void {
17+ $ addon ->initialize = function (array $ options ) use ($ app ): void {
1818 $ forumPagesPathPrefix = isset ($ options ['forumPagesPathPrefix ' ]) ? $ options ['forumPagesPathPrefix ' ] : '/f/ ' ;
1919
2020 $ context = $ app ->contexts ->get (__DIR__ );
@@ -94,7 +94,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
9494 return function_exists ('mb_strlen ' ) ? mb_strlen ($ string ) : strlen ($ string );
9595 };
9696
97- $ substr = function (string $ string , int $ start , int $ length = null ) {
97+ $ substr = function (string $ string , int $ start , ? int $ length = null ) {
9898 return function_exists ('mb_substr ' ) ? mb_substr ($ string , $ start , $ length ) : substr ($ string , $ start , $ length );
9999 };
100100
@@ -131,7 +131,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
131131 }
132132 ]);
133133
134- Internal \Sitemap::addSource (function (Internal \Sitemap \Sitemap $ sitemap ) use ($ app ) {
134+ Internal \Sitemap::addSource (function (Internal \Sitemap \Sitemap $ sitemap ) use ($ app ): void {
135135 $ forumPosts = new Internal \Data \Models \ForumPosts ();
136136 $ posts = $ forumPosts ->getList ()
137137 ->filter (function ($ forumPost ) {
@@ -185,7 +185,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
185185 }
186186 });
187187
188- Internal \Themes::$ elementsOptions ['forumPosts ' ] = ['v2 ' , function ($ options , $ idPrefix , $ parentSelector , $ context , $ details ) {
188+ Internal \Themes::$ elementsOptions ['forumPosts ' ] = ['v2 ' , function ($ options , $ idPrefix , $ parentSelector , $ context , $ details ): void {
189189 $ isElementContext = $ context === Internal \Themes::OPTIONS_CONTEXT_ELEMENT ;
190190 if ($ isElementContext ) {
191191 $ optionsGroup = $ options ;
@@ -287,7 +287,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
287287 }
288288 }];
289289
290- Internal \Themes::$ pagesOptions ['forums ' ] = function ($ options , array $ details = []) {
290+ Internal \Themes::$ pagesOptions ['forums ' ] = function ($ options , array $ details = []): void {
291291
292292 $ groupForumPostPage = $ options ->addGroup (__ ("bearcms.themes.options.Forum post page " ));
293293
@@ -439,7 +439,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
439439 }
440440 });
441441
442- Internal \ServerCommands::add ('forumPostSetStatus ' , function (array $ data ) {
442+ Internal \ServerCommands::add ('forumPostSetStatus ' , function (array $ data ): void {
443443 Internal \Data \Utilities \ForumPosts::setStatus ($ data ['forumPostID ' ], $ data ['status ' ]);
444444 });
445445
@@ -483,12 +483,12 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
483483 return null ;
484484 });
485485
486- Internal \ServerCommands::add ('forumPostReplySetStatus ' , function (array $ data ) use (&$ forumPostsRepliesListCache ) {
486+ Internal \ServerCommands::add ('forumPostReplySetStatus ' , function (array $ data ) use (&$ forumPostsRepliesListCache ): void {
487487 Internal \Data \Utilities \ForumPostsReplies::setStatus ($ data ['forumPostID ' ], $ data ['replyID ' ], $ data ['status ' ]);
488488 $ forumPostsRepliesListCache = null ;
489489 });
490490
491- Internal \ServerCommands::add ('forumPostReplyDelete ' , function (array $ data ) use (&$ forumPostsRepliesListCache ) {
491+ Internal \ServerCommands::add ('forumPostReplyDelete ' , function (array $ data ) use (&$ forumPostsRepliesListCache ): void {
492492 Internal \Data \Utilities \ForumPostsReplies::deleteReplyForever ($ data ['forumPostID ' ], $ data ['replyID ' ]);
493493 $ forumPostsRepliesListCache = null ;
494494 });
@@ -509,7 +509,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
509509
510510 if (Internal \Config::hasFeature ('NOTIFICATIONS ' )) {
511511 $ app ->tasks
512- ->define ('bearcms-send-new-forum-post-notification ' , function ($ data ) {
512+ ->define ('bearcms-send-new-forum-post-notification ' , function ($ data ): void {
513513 $ forumPostID = $ data ['forumPostID ' ];
514514 $ forumPosts = new Internal \Data \Models \ForumPosts ();
515515 $ forumPost = $ forumPosts ->get ($ forumPostID );
@@ -521,7 +521,7 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
521521 Internal \Data::sendNotification ('forum-posts ' , $ forumPost ->status , $ profile ->name , $ forumPost ->title , $ pendingApprovalCount );
522522 }
523523 })
524- ->define ('bearcms-send-new-forum-post-reply-notification ' , function ($ data ) {
524+ ->define ('bearcms-send-new-forum-post-reply-notification ' , function ($ data ): void {
525525 $ forumPostID = $ data ['forumPostID ' ];
526526 $ forumPostReplyID = $ data ['forumPostReplyID ' ];
527527 $ forumPostsReplies = new Internal \Data \Models \ForumPostsReplies ();
@@ -540,13 +540,13 @@ function (App\Request $request) use ($app, $context, $forumPagesPathPrefix) {
540540 }
541541
542542 $ app ->clientPackages
543- ->add ('-bearcms-forums-element ' , function (IvoPetkov \BearFrameworkAddons \ClientPackage $ package ) {
543+ ->add ('-bearcms-forums-element ' , function (IvoPetkov \BearFrameworkAddons \ClientPackage $ package ): void {
544544 //$js = file_get_contents(__DIR__ . '/dev/forumPostsElement.js');
545545 $ js = include __DIR__ . '/assets/forumPostsElement.min.js.php ' ;
546546 $ package ->addJSCode ($ js );
547547 $ package ->embedPackage ('modalWindows ' );
548548 })
549- ->add ('-bearcms-forums-element-reply ' , function (IvoPetkov \BearFrameworkAddons \ClientPackage $ package ) {
549+ ->add ('-bearcms-forums-element-reply ' , function (IvoPetkov \BearFrameworkAddons \ClientPackage $ package ): void {
550550 //$js = file_get_contents(__DIR__ . '/dev/forumPostReply.js');
551551 $ js = include __DIR__ . '/assets/forumPostReply.min.js.php ' ;
552552 $ package ->addJSCode ($ js );
0 commit comments