]> BookStack Code Mirror - bookstack/blobdiff - app/Theming/ThemeService.php
Applied StyleCI changes, added php/larastan to attribution
[bookstack] / app / Theming / ThemeService.php
index 895108e3e2aac8ee5791c266bd30c9ba6c1e951e..602abaf1c5a35e4845cbde67aec8981071271f5c 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace BookStack\Theming;
+<?php
+
+namespace BookStack\Theming;
 
 use BookStack\Auth\Access\SocialAuthService;
 
@@ -26,6 +28,7 @@ class ThemeService
      *
      * If a callback returns a non-null value, this method will
      * stop and return that value itself.
+     *
      * @return mixed
      */
     public function dispatch(string $event, ...$args)
@@ -36,6 +39,7 @@ class ThemeService
                 return $result;
             }
         }
+
         return null;
     }
 
@@ -45,7 +49,7 @@ class ThemeService
     public function readThemeActions()
     {
         $themeActionsFile = theme_path('functions.php');
-        if (file_exists($themeActionsFile)) {
+        if ($themeActionsFile && file_exists($themeActionsFile)) {
             require $themeActionsFile;
         }
     }
@@ -58,4 +62,4 @@ class ThemeService
         $socialAuthService = app()->make(SocialAuthService::class);
         $socialAuthService->addSocialDriver($driverName, $config, $socialiteHandler, $configureForRedirect);
     }
-}
\ No newline at end of file
+}