]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/EntityProvider.php
Applied StyleCI changes, added php/larastan to attribution
[bookstack] / app / Entities / EntityProvider.php
index c77a57d61a5710edf652082839492a394c21a341..aaf392c7b2782b7f54199d4d7398ce8a3059c7d8 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace BookStack\Entities;
+<?php
+
+namespace BookStack\Entities;
 
 use BookStack\Entities\Models\Book;
 use BookStack\Entities\Models\Bookshelf;
@@ -8,7 +10,7 @@ use BookStack\Entities\Models\Page;
 use BookStack\Entities\Models\PageRevision;
 
 /**
- * Class EntityProvider
+ * Class EntityProvider.
  *
  * Provides access to the core entity models.
  * Wrapped up in this provider since they are often used together
@@ -16,7 +18,6 @@ use BookStack\Entities\Models\PageRevision;
  */
 class EntityProvider
 {
-
     /**
      * @var Bookshelf
      */
@@ -42,7 +43,6 @@ class EntityProvider
      */
     public $pageRevision;
 
-
     public function __construct()
     {
         $this->bookshelf = new Bookshelf();
@@ -55,15 +55,16 @@ class EntityProvider
     /**
      * Fetch all core entity types as an associated array
      * with their basic names as the keys.
+     *
      * @return array<Entity>
      */
     public function all(): array
     {
         return [
             'bookshelf' => $this->bookshelf,
-            'book' => $this->book,
-            'chapter' => $this->chapter,
-            'page' => $this->page,
+            'book'      => $this->book,
+            'chapter'   => $this->chapter,
+            'page'      => $this->page,
         ];
     }
 
@@ -73,6 +74,7 @@ class EntityProvider
     public function get(string $type): Entity
     {
         $type = strtolower($type);
+
         return $this->all()[$type];
     }
 
@@ -86,6 +88,7 @@ class EntityProvider
             $model = $this->get($type);
             $morphClasses[] = $model->getMorphClass();
         }
+
         return $morphClasses;
     }
 }