From 9a716acb29afda14c9f00073e5f947f253d9496d Mon Sep 17 00:00:00 2001 From: ro Date: Thu, 28 Mar 2024 15:13:13 -0600 Subject: [PATCH] removed string service moved methods of string service to helper function and got rid of the string service class still messing around with the sorter helper to see how dependecies work. sorting as a helper may be a bit too complex for what help functions are supposed to be --- app/Helpers/PageSorter.php | 6 ++- app/Helpers/StringHelpers.php | 40 ++++++++++++++++++- app/Providers/FipamoServiceProvider.php | 7 ---- app/Services/ContentService.php | 5 +++ app/Services/SortingService.php | 7 +--- app/Services/StringService.php | 51 ------------------------- 6 files changed, 50 insertions(+), 66 deletions(-) delete mode 100644 app/Services/StringService.php diff --git a/app/Helpers/PageSorter.php b/app/Helpers/PageSorter.php index 874deef..d439057 100644 --- a/app/Helpers/PageSorter.php +++ b/app/Helpers/PageSorter.php @@ -1,6 +1,10 @@ loadAllPages(); + echo(count($pages)); } diff --git a/app/Helpers/StringHelpers.php b/app/Helpers/StringHelpers.php index 04a646f..d674b2c 100644 --- a/app/Helpers/StringHelpers.php +++ b/app/Helpers/StringHelpers.php @@ -1,6 +1,42 @@ app->bind(StringService::class, function ($app) { - return new StringService(); - }); - $this->app->bind(DocService::class, function ($app) { return new DocService(); }); @@ -62,7 +57,6 @@ class FipamoServiceProvider extends ServiceProvider new SortingService( new SettingsService(new DocService(), new ContentService()), new ContentService(), - new StringService(), new ThemeService(new SettingsService(new DocService(), new ContentService())) ), new SettingsService(new DocService(), new ContentService()), @@ -74,7 +68,6 @@ class FipamoServiceProvider extends ServiceProvider return new SortingService( new SettingsService(new DocService(), new ContentService()), new ContentService(), - new StringService(), new ThemeService(new SettingsService(new DocService(), new ContentService())) ); }); diff --git a/app/Services/ContentService.php b/app/Services/ContentService.php index c4be81b..2199b57 100644 --- a/app/Services/ContentService.php +++ b/app/Services/ContentService.php @@ -192,4 +192,9 @@ class ContentService $sorted->values()->all(); return $sorted; } + + public static function getAll() + { + echo("YES"); + } } diff --git a/app/Services/SortingService.php b/app/Services/SortingService.php index c9116b0..c0a6d09 100644 --- a/app/Services/SortingService.php +++ b/app/Services/SortingService.php @@ -13,18 +13,15 @@ class SortingService private $p_archive = []; private $settings; private $contents; - private $strings; private $themes; public function __construct( SettingsService $settingsService, ContentService $contentService, - StringService $stringService, ThemeService $themeService, ) { $this->settings = $settingsService; $this->contents = $contentService; - $this->strings = $stringService; $this->themes = $themeService; } @@ -40,7 +37,7 @@ class SortingService if (!find($this->p_tags, ['tag_name' => $label])) { array_push($this->p_tags, [ 'tag_name' => $label, - 'slug' => $this->strings::safeString($label), + 'slug' => safeString($label), 'pages' => $this->tagPages($label, $pages), ]); } @@ -178,7 +175,7 @@ class SortingService $label = trim($tag); array_push($tags, [ 'label' => $label . ' ', - 'slug' => $this->strings->safeString($label), + 'slug' => safeString($label), ]); } } diff --git a/app/Services/StringService.php b/app/Services/StringService.php deleted file mode 100644 index 23a97bb..0000000 --- a/app/Services/StringService.php +++ /dev/null @@ -1,51 +0,0 @@ -