From 20e394e9f27aab0cb522f84f3d636b279ecb863e Mon Sep 17 00:00:00 2001 From: Frankie B Date: Wed, 14 Jun 2023 22:52:00 +0100 Subject: [PATCH] Move classes to models folder --- app/Models/Bookmark.php | 29 ++++++++++++ app/Models/BookmarkCategory.php | 22 +++++++++ app/Models/Project.php | 36 +++++++++++++++ app/Models/ProjectCategory.php | 22 +++++++++ config/bookmarks.php | 53 +-------------------- config/projects.php | 82 +-------------------------------- 6 files changed, 113 insertions(+), 131 deletions(-) create mode 100644 app/Models/Bookmark.php create mode 100644 app/Models/BookmarkCategory.php create mode 100644 app/Models/Project.php create mode 100644 app/Models/ProjectCategory.php diff --git a/app/Models/Bookmark.php b/app/Models/Bookmark.php new file mode 100644 index 0000000..f679205 --- /dev/null +++ b/app/Models/Bookmark.php @@ -0,0 +1,29 @@ +name = $name; + $this->url = $url; + $this->description = $description; + } +} diff --git a/app/Models/BookmarkCategory.php b/app/Models/BookmarkCategory.php new file mode 100644 index 0000000..0f2335d --- /dev/null +++ b/app/Models/BookmarkCategory.php @@ -0,0 +1,22 @@ +name = $name; + $this->bookmarks = $bookmarks; + } +} diff --git a/app/Models/Project.php b/app/Models/Project.php new file mode 100644 index 0000000..0b90828 --- /dev/null +++ b/app/Models/Project.php @@ -0,0 +1,36 @@ +name = $name; + $this->description = $description; + $this->url = $url; + $this->languages = $languages; + } +} diff --git a/app/Models/ProjectCategory.php b/app/Models/ProjectCategory.php new file mode 100644 index 0000000..babe265 --- /dev/null +++ b/app/Models/ProjectCategory.php @@ -0,0 +1,22 @@ +name = $name; + $this->projects = $projects; + } +} diff --git a/config/bookmarks.php b/config/bookmarks.php index 88e2cd9..3138d69 100644 --- a/config/bookmarks.php +++ b/config/bookmarks.php @@ -1,55 +1,6 @@ name = $name; - $this->url = $url; - $this->description = $description; - } -} - -class BookmarkCategory { - /** - * @var string The name of the bookmark category. - */ - public $name; - - /** - * @var array An array of Bookmark objects. - */ - public $bookmarks; - - /** - * BookmarkCategory constructor. - * @param string $name The name of the bookmark category. - * @param array $bookmarks An array of Bookmark objects. - */ - public function __construct($name, $bookmarks = array()) { - $this->name = $name; - $this->bookmarks = $bookmarks; - } -} - +include 'app/Models/Bookmark.php'; +include 'app/Models/BookmarkCategory.php'; return [ new BookmarkCategory("Friends' Websites", [ diff --git a/config/projects.php b/config/projects.php index 36a150e..4a523fa 100644 --- a/config/projects.php +++ b/config/projects.php @@ -1,84 +1,6 @@ name = $name; - $this->url = $url; - } -} - -class Project { - /** - * @var string The name of the project. - */ - public $name; - - /** - * @var string The description of the project. - */ - public $description; - - /** - * @var string The URL of the project. - */ - public $url; - - /** - * @var array Languages used in the project. - */ - public $languages; - - /** - * BookmarkCategory constructor. - * @param string $name The name of the project. - * @param string $description The description of the project. - * @param string The URL of the project. - * @param array $languages Languages used in the project.s - */ - public function __construct($name, $description, $url, $languages = array()) { - $this->name = $name; - $this->description = $description; - $this->url = $url; - $this->languages = $languages; - } -} - -class ProjectCategory { - /** - * @var string The name of the bookmark category. - */ - public $name; - - /** - * @var array An array of Project objects. - */ - public $projects; - - /** - * BookmarkCategory constructor. - * @param string $name The name of the bookmark category. - * @param array $projects An array of Project objects. - */ - public function __construct($name, $projects = array()) { - $this->name = $name; - $this->projects = $projects; - } -} - +include 'app/Models/Project.php'; +include 'app/Models/ProjectCategory.php'; return [ new ProjectCategory("Websites", [