From b6e81f9906b20f5deedebc086f6d11e76c2fe03b Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 22 Dec 2024 20:56:01 +0100 Subject: [PATCH] Use constructor property promotion for clean code --- src/Cms/ModelPermissions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Cms/ModelPermissions.php b/src/Cms/ModelPermissions.php index ba9b0010ba..a9e75cc0c0 100644 --- a/src/Cms/ModelPermissions.php +++ b/src/Cms/ModelPermissions.php @@ -16,14 +16,12 @@ abstract class ModelPermissions { protected string $category; - protected ModelWithContent|Language $model; protected array $options; protected Permissions $permissions; protected User $user; - public function __construct(ModelWithContent|Language $model) + public function __construct(protected ModelWithContent|Language $model) { - $this->model = $model; $this->user = $model->kirby()->user() ?? User::nobody(); $this->permissions = $this->user->role()->permissions();