]> BookStack Code Mirror - bookstack/blobdiff - app/App/helpers.php
added routes for zip export
[bookstack] / app / App / helpers.php
index 204b3f06a72494433cbfea8cb9a8c7ffed6126e4..eec86553fb431c9fe7c638529b5ca80626c3feba 100644 (file)
@@ -43,9 +43,9 @@ function user(): User
  * Check if the current user has a permission. If an ownable element
  * is passed in the jointPermissions are checked against that particular item.
  */
-function userCan(string $permission, Model $ownable = null): bool
+function userCan(string $permission, ?Model $ownable = null): bool
 {
-    if ($ownable === null) {
+    if (is_null($ownable)) {
         return user()->can($permission);
     }
 
@@ -71,7 +71,7 @@ function userCanOnAny(string $action, string $entityClass = ''): bool
  *
  * @return mixed|SettingService
  */
-function setting(string $key = null, $default = null)
+function setting(?string $key = null, mixed $default = null): mixed
 {
     $settingService = app()->make(SettingService::class);