]> BookStack Code Mirror - bookstack/commitdiff
Moved models to folder, renamed managers to tools
authorDan Brown <redacted>
Sat, 21 Nov 2020 23:20:54 +0000 (23:20 +0000)
committerDan Brown <redacted>
Sat, 21 Nov 2020 23:20:54 +0000 (23:20 +0000)
Tools seems to fit better since the classes were a bit of a mixed bunch
and did not always manage.
Also simplified the structure of the SlugGenerator class.
Also focused EntityContext on shelves and simplified to use session
helper.

45 files changed:
app/Actions/Tag.php
app/Api/ApiToken.php
app/Auth/Access/Guards/ExternalBaseSessionGuard.php
app/Auth/Access/Guards/Saml2SessionGuard.php
app/Auth/Access/Ldap.php
app/Auth/SocialAccount.php
app/Auth/User.php
app/Entities/BreadcrumbsViewComposer.php
app/Entities/EntityProvider.php
app/Entities/ExportService.php
app/Entities/Models/Book.php [moved from app/Entities/Book.php with 99% similarity]
app/Entities/Models/BookChild.php [moved from app/Entities/BookChild.php with 97% similarity]
app/Entities/Models/Bookshelf.php [moved from app/Entities/Bookshelf.php with 100% similarity]
app/Entities/Models/Chapter.php [moved from app/Entities/Chapter.php with 98% similarity]
app/Entities/Models/Deletion.php [moved from app/Entities/Deletion.php with 100% similarity]
app/Entities/Models/Entity.php [moved from app/Entities/Entity.php with 98% similarity]
app/Entities/Models/HasCoverImage.php [moved from app/Entities/HasCoverImage.php with 100% similarity]
app/Entities/Models/Page.php [moved from app/Entities/Page.php with 100% similarity]
app/Entities/Models/PageRevision.php [moved from app/Entities/PageRevision.php with 100% similarity]
app/Entities/Models/SearchTerm.php [moved from app/Entities/SearchTerm.php with 100% similarity]
app/Entities/Repos/BookRepo.php
app/Entities/Repos/BookshelfRepo.php
app/Entities/Repos/ChapterRepo.php
app/Entities/Repos/PageRepo.php
app/Entities/Tools/BookContents.php [moved from app/Entities/Managers/BookContents.php with 99% similarity]
app/Entities/Tools/PageContent.php [moved from app/Entities/Managers/PageContent.php with 99% similarity]
app/Entities/Tools/PageEditActivity.php [moved from app/Entities/Managers/PageEditActivity.php with 98% similarity]
app/Entities/Tools/SearchOptions.php [moved from app/Entities/SearchOptions.php with 100% similarity]
app/Entities/Tools/ShelfContext.php [moved from app/Entities/Managers/EntityContext.php with 60% similarity]
app/Entities/Tools/SlugGenerator.php [moved from app/Entities/SlugGenerator.php with 54% similarity]
app/Entities/Tools/TrashCan.php [moved from app/Entities/Managers/TrashCan.php with 99% similarity]
app/Http/Controllers/BookController.php
app/Http/Controllers/BookSortController.php
app/Http/Controllers/BookshelfController.php
app/Http/Controllers/ChapterController.php
app/Http/Controllers/HomeController.php
app/Http/Controllers/MaintenanceController.php
app/Http/Controllers/PageController.php
app/Http/Controllers/PageExportController.php
app/Http/Controllers/PageRevisionController.php
app/Http/Controllers/RecycleBinController.php
app/Http/Controllers/SearchController.php
tests/AuditLogTest.php
tests/Entity/PageContentTest.php
tests/Uploads/AttachmentTest.php

index 80a91150868e9cd87be62685891237c392606328..709b1ddebc04fd88d853371b07fe8de577908880 100644 (file)
@@ -2,10 +2,6 @@
 
 use BookStack\Model;
 
-/**
- * Class Attribute
- * @package BookStack
- */
 class Tag extends Model
 {
     protected $fillable = ['name', 'value', 'order'];
index 91c407fd8b54c1d9c403a17955796fa76d7f48da..defaa7e954af69354fc3f3c637720f392fbc005c 100644 (file)
@@ -14,7 +14,6 @@ use Illuminate\Support\Carbon;
  * @property string $name
  * @property Carbon $expires_at
  * @property User $user
- * @package BookStack\Api
  */
 class ApiToken extends Model implements Loggable
 {
index f3d05366d9544ee5dde9c1a17304199b83f834c7..9a0c691c8bbb272301c45bccbf6b7c3739554f84 100644 (file)
@@ -15,8 +15,6 @@ use Illuminate\Contracts\Session\Session;
  * guard with 'remember' functionality removed. Basic auth and event emission
  * has also been removed to keep this simple. Designed to be extended by external
  * Auth Guards.
- *
- * @package Illuminate\Auth
  */
 class ExternalBaseSessionGuard implements StatefulGuard
 {
index 4023913ed77bb47caac93d5dc0d84a6673be4f90..68683bb4368b61ac23769fdce2eeb1ed7e876497 100644 (file)
@@ -9,8 +9,6 @@ namespace BookStack\Auth\Access\Guards;
  * into the default laravel 'Guard' auth flow. Instead most of the logic is done
  * via the Saml2 controller & Saml2Service. This class provides a safer, thin
  * version of SessionGuard.
- *
- * @package BookStack\Auth\Access\Guards
  */
 class Saml2SessionGuard extends ExternalBaseSessionGuard
 {
index 843a2f204920e9bd5154efe477c5212f73efa057..6b7bd9b9bf2a4d4699a74609ab507d33cc72f98d 100644 (file)
@@ -4,7 +4,6 @@
  * Class Ldap
  * An object-orientated thin abstraction wrapper for common PHP LDAP functions.
  * Allows the standard LDAP functions to be mocked for testing.
- * @package BookStack\Services
  */
 class Ldap
 {
index 1c83980cb2fe355cfe61be3802bf8fc34b934e24..116cdc8546957a4071ad54bbc52aba5b8b6ede6c 100644 (file)
@@ -7,7 +7,6 @@ use BookStack\Model;
  * Class SocialAccount
  * @property string $driver
  * @property User $user
- * @package BookStack\Auth
  */
 class SocialAccount extends Model implements Loggable
 {
index 5feb269e2bd1ce7fc230070faac1b6f067a55e93..32179a1fbb8d1e97300d4a5445975014705a4631 100644 (file)
@@ -18,7 +18,6 @@ use Illuminate\Notifications\Notifiable;
 
 /**
  * Class User
- * @package BookStack\Auth
  * @property string $id
  * @property string $name
  * @property string $email
index 43d63d026021dd07edcb1165841018ee213b13a3..fd0152a7bcf3d271eca0c0e1c978aeb25bf59b17 100644 (file)
@@ -1,6 +1,6 @@
 <?php namespace BookStack\Entities;
 
-use BookStack\Entities\Managers\EntityContext;
+use BookStack\Entities\Tools\ShelfContext;
 use Illuminate\View\View;
 
 class BreadcrumbsViewComposer
@@ -10,9 +10,9 @@ class BreadcrumbsViewComposer
 
     /**
      * BreadcrumbsViewComposer constructor.
-     * @param EntityContext $entityContextManager
+     * @param ShelfContext $entityContextManager
      */
-    public function __construct(EntityContext $entityContextManager)
+    public function __construct(ShelfContext $entityContextManager)
     {
         $this->entityContextManager = $entityContextManager;
     }
index d28afe6f2c13701e87e898726e29af1e7745bdd8..2246f11f710fd2722994fa3589f748f7508b7d1c 100644 (file)
@@ -6,8 +6,6 @@
  * Provides access to the core entity models.
  * Wrapped up in this provider since they are often used together
  * so this is a neater alternative to injecting all in individually.
- *
- * @package BookStack\Entities
  */
 class EntityProvider
 {
index f945dfbe4afe1d17246ca7119c6e776c4acf0455..c2057481b339dc1c58b89079d2a0ba5dc4e1cc20 100644 (file)
@@ -1,7 +1,7 @@
 <?php namespace BookStack\Entities;
 
-use BookStack\Entities\Managers\BookContents;
-use BookStack\Entities\Managers\PageContent;
+use BookStack\Entities\Tools\BookContents;
+use BookStack\Entities\Tools\PageContent;
 use BookStack\Uploads\ImageService;
 use DomPDF;
 use Exception;
similarity index 99%
rename from app/Entities/Book.php
rename to app/Entities/Models/Book.php
index af8344b88f5cb440b9abeb6913e3e55ffeda68f6..a5503730b915f8627c350bd1de9a473e243b40dc 100644 (file)
@@ -12,7 +12,6 @@ use Illuminate\Support\Collection;
  * @property string $description
  * @property int $image_id
  * @property Image|null $cover
- * @package BookStack\Entities
  */
 class Book extends Entity implements HasCoverImage
 {
similarity index 97%
rename from app/Entities/BookChild.php
rename to app/Entities/Models/BookChild.php
index 042b56e288989b141a5c5f44e8ccb1f058776aa3..f05a25499b03bc3a0cf2e688f62ef2c26d9f2717 100644 (file)
@@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
  * @property Book $book
  * @method Builder whereSlugs(string $bookSlug, string $childSlug)
  */
-class BookChild extends Entity
+abstract class BookChild extends Entity
 {
 
     /**
similarity index 98%
rename from app/Entities/Chapter.php
rename to app/Entities/Models/Chapter.php
index 3290afcfa6b90b0b01b653f99dfd7f93598f6556..69dafe8acfefbc0abbadc99925bcefcc6eea913c 100644 (file)
@@ -5,7 +5,6 @@ use Illuminate\Support\Collection;
 /**
  * Class Chapter
  * @property Collection<Page> $pages
- * @package BookStack\Entities
  */
 class Chapter extends BookChild
 {
similarity index 98%
rename from app/Entities/Entity.php
rename to app/Entities/Models/Entity.php
index 99922bcebe50047c18563da197091d3b9bca1215..29853fe309760807d3b1fa17606e996e1754ca9d 100644 (file)
@@ -32,8 +32,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
  * @method static Entity|Builder hasPermission(string $permission)
  * @method static Builder withLastView()
  * @method static Builder withViewCount()
- *
- * @package BookStack\Entities
  */
 class Entity extends Ownable
 {
@@ -326,8 +324,7 @@ class Entity extends Ownable
      */
     public function refreshSlug(): string
     {
-        $generator = new SlugGenerator($this);
-        $this->slug = $generator->generate();
+        $this->slug = (new SlugGenerator)->generate($this);
         return $this->slug;
     }
 }
index f32dd858233f713a3d67ce1d06768086798ab258..3fb924a89a0554604ffc4647d6a9fcaec922dd5c 100644 (file)
@@ -3,7 +3,7 @@
 use BookStack\Actions\ActivityType;
 use BookStack\Actions\TagRepo;
 use BookStack\Entities\Book;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Exceptions\ImageUploadException;
 use BookStack\Exceptions\NotFoundException;
 use BookStack\Facades\Activity;
index 0392782287a62efb69f5269a1039a214f911127b..8f12e9dc0dc1c3e5ac7a865e4f00cc0b847c1465 100644 (file)
@@ -3,7 +3,7 @@
 use BookStack\Actions\ActivityType;
 use BookStack\Entities\Book;
 use BookStack\Entities\Bookshelf;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Exceptions\ImageUploadException;
 use BookStack\Exceptions\NotFoundException;
 use BookStack\Facades\Activity;
index 312cb69e5481b59a339028b891055d4b7ae9729c..aa9784c2d719fbfe36a2e8a21710803b9018cfc3 100644 (file)
@@ -3,8 +3,8 @@
 use BookStack\Actions\ActivityType;
 use BookStack\Entities\Book;
 use BookStack\Entities\Chapter;
-use BookStack\Entities\Managers\BookContents;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\BookContents;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Exceptions\MoveOperationException;
 use BookStack\Exceptions\NotFoundException;
 use BookStack\Facades\Activity;
index 0e5b484824f07cd1f1cce6851d17525a7509d86d..7ea79efe6cce8f94761a0ce31f58bf86a469fc5d 100644 (file)
@@ -4,9 +4,9 @@ use BookStack\Actions\ActivityType;
 use BookStack\Entities\Book;
 use BookStack\Entities\Chapter;
 use BookStack\Entities\Entity;
-use BookStack\Entities\Managers\BookContents;
-use BookStack\Entities\Managers\PageContent;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\BookContents;
+use BookStack\Entities\Tools\PageContent;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Entities\Page;
 use BookStack\Entities\PageRevision;
 use BookStack\Exceptions\MoveOperationException;
similarity index 99%
rename from app/Entities/Managers/BookContents.php
rename to app/Entities/Tools/BookContents.php
index 52447e43bf0b397d4c69782fed8453793e3a13bf..ae9a95f460c1c1a2fcf258c592d6d3cb5c520154 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace BookStack\Entities\Managers;
+<?php namespace BookStack\Entities\Tools;
 
 use BookStack\Entities\Book;
 use BookStack\Entities\BookChild;
@@ -18,7 +18,6 @@ class BookContents
 
     /**
      * BookContents constructor.
-     * @param $book
      */
     public function __construct(Book $book)
     {
similarity index 99%
rename from app/Entities/Managers/PageContent.php
rename to app/Entities/Tools/PageContent.php
index 7338a36b393631289a8f30ce09888d403d52763e..2d3b324a1c21c824e324133de523cdbb3c9b5a4e 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace BookStack\Entities\Managers;
+<?php namespace BookStack\Entities\Tools;
 
 use BookStack\Entities\Page;
 use DOMDocument;
similarity index 98%
rename from app/Entities/Managers/PageEditActivity.php
rename to app/Entities/Tools/PageEditActivity.php
index cebbf8720f12a0ac7d66b8cc9e67dae3a5719db7..5fb7128b76595bee490f69faf874fd8c19a4adfb 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace BookStack\Entities\Managers;
+<?php namespace BookStack\Entities\Tools;
 
 use BookStack\Entities\Page;
 use BookStack\Entities\PageRevision;
similarity index 60%
rename from app/Entities/Managers/EntityContext.php
rename to app/Entities/Tools/ShelfContext.php
index 551cd1a100c142f26cea88d8e86aaa282c768fa0..0635bce1cbd753569a442f2350f7cae672c47326 100644 (file)
@@ -1,29 +1,18 @@
-<?php namespace BookStack\Entities\Managers;
+<?php namespace BookStack\Entities\Tools;
 
 use BookStack\Entities\Book;
 use BookStack\Entities\Bookshelf;
-use Illuminate\Session\Store;
 
-class EntityContext
+class ShelfContext
 {
-    protected $session;
-
     protected $KEY_SHELF_CONTEXT_ID = 'context_bookshelf_id';
 
-    /**
-     * EntityContextManager constructor.
-     */
-    public function __construct(Store $session)
-    {
-        $this->session = $session;
-    }
-
     /**
      * Get the current bookshelf context for the given book.
      */
     public function getContextualShelfForBook(Book $book): ?Bookshelf
     {
-        $contextBookshelfId = $this->session->get($this->KEY_SHELF_CONTEXT_ID, null);
+        $contextBookshelfId = session()->get($this->KEY_SHELF_CONTEXT_ID, null);
 
         if (!is_int($contextBookshelfId)) {
             return null;
@@ -37,11 +26,10 @@ class EntityContext
 
     /**
      * Store the current contextual shelf ID.
-     * @param int $shelfId
      */
     public function setShelfContext(int $shelfId)
     {
-        $this->session->put($this->KEY_SHELF_CONTEXT_ID, $shelfId);
+        session()->put($this->KEY_SHELF_CONTEXT_ID, $shelfId);
     }
 
     /**
@@ -49,6 +37,6 @@ class EntityContext
      */
     public function clearShelfContext()
     {
-        $this->session->forget($this->KEY_SHELF_CONTEXT_ID);
+        session()->forget($this->KEY_SHELF_CONTEXT_ID);
     }
 }
similarity index 54%
rename from app/Entities/SlugGenerator.php
rename to app/Entities/Tools/SlugGenerator.php
index e8bc556abefa102153b64953a6dc76c89784e206..884f126e8ecf7edd9d1ce61f2fe5c0a36395b0aa 100644 (file)
@@ -5,25 +5,14 @@ use Illuminate\Support\Str;
 class SlugGenerator
 {
 
-    protected $entity;
-
-    /**
-     * SlugGenerator constructor.
-     * @param $entity
-     */
-    public function __construct(Entity $entity)
-    {
-        $this->entity = $entity;
-    }
-
     /**
      * Generate a fresh slug for the given entity.
      * The slug will generated so it does not conflict within the same parent item.
      */
-    public function generate(): string
+    public function generate(Entity $entity): string
     {
-        $slug = $this->formatNameAsSlug($this->entity->name);
-        while ($this->slugInUse($slug)) {
+        $slug = $this->formatNameAsSlug($entity->name);
+        while ($this->slugInUse($slug, $entity)) {
             $slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
         }
         return $slug;
@@ -45,16 +34,16 @@ class SlugGenerator
      * Check if a slug is already in-use for this
      * type of model within the same parent.
      */
-    protected function slugInUse(string $slug): bool
+    protected function slugInUse(string $slug, Entity $entity): bool
     {
-        $query = $this->entity->newQuery()->where('slug', '=', $slug);
+        $query = $entity->newQuery()->where('slug', '=', $slug);
 
-        if ($this->entity instanceof BookChild) {
-            $query->where('book_id', '=', $this->entity->book_id);
+        if ($entity instanceof BookChild) {
+            $query->where('book_id', '=', $entity->book_id);
         }
 
-        if ($this->entity->id) {
-            $query->where('id', '!=', $this->entity->id);
+        if ($entity->id) {
+            $query->where('id', '!=', $entity->id);
         }
 
         return $query->count() > 0;
similarity index 99%
rename from app/Entities/Managers/TrashCan.php
rename to app/Entities/Tools/TrashCan.php
index 48768ab9375ee81acb1a99e6ce19a60e3de112d2..62d373e97eba0861e45c3beb68f483e13561d3f5 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace BookStack\Entities\Managers;
+<?php namespace BookStack\Entities\Tools;
 
 use BookStack\Entities\Book;
 use BookStack\Entities\Bookshelf;
index 07a30996e2e3e109a12bbeaefc7ae95b8a878474..0fadc0f4dab6c61095f875978f4bff05e8c779f7 100644 (file)
@@ -2,9 +2,9 @@
 
 use Activity;
 use BookStack\Actions\ActivityType;
-use BookStack\Entities\Managers\BookContents;
+use BookStack\Entities\Tools\BookContents;
 use BookStack\Entities\Bookshelf;
-use BookStack\Entities\Managers\EntityContext;
+use BookStack\Entities\Tools\ShelfContext;
 use BookStack\Entities\Repos\BookRepo;
 use BookStack\Exceptions\ImageUploadException;
 use Illuminate\Http\Request;
@@ -18,7 +18,7 @@ class BookController extends Controller
     protected $bookRepo;
     protected $entityContextManager;
 
-    public function __construct(EntityContext $entityContextManager, BookRepo $bookRepo)
+    public function __construct(ShelfContext $entityContextManager, BookRepo $bookRepo)
     {
         $this->bookRepo = $bookRepo;
         $this->entityContextManager = $entityContextManager;
index 6d561cfce711c105edd64041869cd3b1aea9595a..7ba11aded6620dee7af8220f4a67345cbd8ed935 100644 (file)
@@ -4,7 +4,7 @@ namespace BookStack\Http\Controllers;
 
 use BookStack\Actions\ActivityType;
 use BookStack\Entities\Book;
-use BookStack\Entities\Managers\BookContents;
+use BookStack\Entities\Tools\BookContents;
 use BookStack\Entities\Repos\BookRepo;
 use BookStack\Exceptions\SortOperationException;
 use BookStack\Facades\Activity;
index 3001a93f4d20677df4edb3f5164bbe23f22ea918..52de74b66fbd03e4066ec4ecdef16934338194e8 100644 (file)
@@ -2,7 +2,7 @@
 
 use Activity;
 use BookStack\Entities\Book;
-use BookStack\Entities\Managers\EntityContext;
+use BookStack\Entities\Tools\ShelfContext;
 use BookStack\Entities\Repos\BookshelfRepo;
 use BookStack\Exceptions\ImageUploadException;
 use BookStack\Exceptions\NotFoundException;
@@ -22,7 +22,7 @@ class BookshelfController extends Controller
     /**
      * BookController constructor.
      */
-    public function __construct(BookshelfRepo $bookshelfRepo, EntityContext $entityContextManager, ImageRepo $imageRepo)
+    public function __construct(BookshelfRepo $bookshelfRepo, ShelfContext $entityContextManager, ImageRepo $imageRepo)
     {
         $this->bookshelfRepo = $bookshelfRepo;
         $this->entityContextManager = $entityContextManager;
index e085a0dc78a874afd74e888836a73027f137a997..7fc92a8cff64590cf66b2c9d84d4641735c1afce 100644 (file)
@@ -1,7 +1,7 @@
 <?php namespace BookStack\Http\Controllers;
 
 use BookStack\Entities\Book;
-use BookStack\Entities\Managers\BookContents;
+use BookStack\Entities\Tools\BookContents;
 use BookStack\Entities\Repos\ChapterRepo;
 use BookStack\Exceptions\MoveOperationException;
 use BookStack\Exceptions\NotFoundException;
index 3b8b7c6e2e06dc6d6ccd711e8a3a57d368965852..fb3ba8e85592b618998162e7966a406550fe7795 100644 (file)
@@ -2,7 +2,7 @@
 
 use Activity;
 use BookStack\Entities\Book;
-use BookStack\Entities\Managers\PageContent;
+use BookStack\Entities\Tools\PageContent;
 use BookStack\Entities\Page;
 use BookStack\Entities\Repos\BookRepo;
 use BookStack\Entities\Repos\BookshelfRepo;
index a638b69cd6d9dfa8d8a180f0d626f72819d345f5..3354a148cfd1f08a628b0f30c0f15d7a4f15b21b 100644 (file)
@@ -3,7 +3,7 @@
 namespace BookStack\Http\Controllers;
 
 use BookStack\Actions\ActivityType;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Notifications\TestEmail;
 use BookStack\Uploads\ImageService;
 use Illuminate\Http\Request;
index 4d79a5e2f74cf0002f46fbc51e9677303bc1fd5d..016aa2f90a2869de9caf47a55aa4fb6a554d6b69 100644 (file)
@@ -1,8 +1,8 @@
 <?php namespace BookStack\Http\Controllers;
 
-use BookStack\Entities\Managers\BookContents;
-use BookStack\Entities\Managers\PageContent;
-use BookStack\Entities\Managers\PageEditActivity;
+use BookStack\Entities\Tools\BookContents;
+use BookStack\Entities\Tools\PageContent;
+use BookStack\Entities\Tools\PageEditActivity;
 use BookStack\Entities\Page;
 use BookStack\Entities\Repos\PageRepo;
 use BookStack\Exceptions\NotFoundException;
index 97ce6ea8529f2be4fb8ae49c631d58434ef43f67..92898dc61ab41f8d3da211a801d3ea287eb279e8 100644 (file)
@@ -3,7 +3,7 @@
 namespace BookStack\Http\Controllers;
 
 use BookStack\Entities\ExportService;
-use BookStack\Entities\Managers\PageContent;
+use BookStack\Entities\Tools\PageContent;
 use BookStack\Entities\Repos\PageRepo;
 use BookStack\Exceptions\NotFoundException;
 use Throwable;
index 7163e3d5eec3952863a9c6d1248f8e32cbf810d6..d5520166db61b34d8dc764210739b91c5108b67a 100644 (file)
@@ -1,6 +1,6 @@
 <?php namespace BookStack\Http\Controllers;
 
-use BookStack\Entities\Managers\PageContent;
+use BookStack\Entities\Tools\PageContent;
 use BookStack\Entities\Repos\PageRepo;
 use BookStack\Exceptions\NotFoundException;
 use GatherContent\Htmldiff\Htmldiff;
index 1a02caba0ab62a143f1b082ead57abd778e4e28c..ebf9bd16caa50a7544e24672423eed3437bdedf4 100644 (file)
@@ -2,7 +2,7 @@
 
 use BookStack\Actions\ActivityType;
 use BookStack\Entities\Deletion;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 
 class RecycleBinController extends Controller
 {
index 4bc466e163307d8d6b309205ea829c5d0853dd08..3a7ca62ba7d75acb2e8bbde82d51393b127b3923 100644 (file)
@@ -4,7 +4,7 @@ use BookStack\Actions\ViewService;
 use BookStack\Entities\Book;
 use BookStack\Entities\Bookshelf;
 use BookStack\Entities\Entity;
-use BookStack\Entities\Managers\EntityContext;
+use BookStack\Entities\Tools\ShelfContext;
 use BookStack\Entities\SearchService;
 use BookStack\Entities\SearchOptions;
 use Illuminate\Http\Request;
@@ -21,7 +21,7 @@ class SearchController extends Controller
     public function __construct(
         ViewService $viewService,
         SearchService $searchService,
-        EntityContext $entityContextManager
+        ShelfContext $entityContextManager
     ) {
         $this->viewService = $viewService;
         $this->searchService = $searchService;
index efe842aa1421c5a77f2127ad44995fbd37b8b448..fa3ee52aa1d8d2ba772feb9ddbbc4ca66cb64339 100644 (file)
@@ -4,7 +4,7 @@ use BookStack\Actions\Activity;
 use BookStack\Actions\ActivityService;
 use BookStack\Actions\ActivityType;
 use BookStack\Auth\UserRepo;
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Entities\Page;
 use BookStack\Entities\Repos\PageRepo;
 use Carbon\Carbon;
index e97df2c7edd80725bb9e830f9cebf8146def5c69..6a7b58ffb62fbbe4b5f640c940a9ae4c23fef9dd 100644 (file)
@@ -1,6 +1,6 @@
 <?php namespace Tests\Entity;
 
-use BookStack\Entities\Managers\PageContent;
+use BookStack\Entities\Tools\PageContent;
 use BookStack\Entities\Page;
 use Tests\TestCase;
 
index 5b73aa6ae1a2d925ac9c0991d8e57fecc837b3fc..9662c075b3de04d48057612a3a6594ce895bdcc4 100644 (file)
@@ -1,6 +1,6 @@
 <?php namespace Tests\Uploads;
 
-use BookStack\Entities\Managers\TrashCan;
+use BookStack\Entities\Tools\TrashCan;
 use BookStack\Entities\Repos\PageRepo;
 use BookStack\Uploads\Attachment;
 use BookStack\Entities\Page;